package wgctrl
import "golang.zx2c4.com/wireguard/wgctrl"
Package wgctrl enables control of WireGuard devices on multiple platforms.
For more information on WireGuard, please see https://www.wireguard.com/.
This package implements WireGuard configuration protocol operations, enabling the configuration of existing WireGuard devices. Operations such as creating WireGuard devices, or applying IP addresses to those devices, are out of scope for this package.
Index ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
A Client provides access to WireGuard device information.
func New ¶
New creates a new Client.
func (*Client) Close ¶
Close releases resources used by a Client.
func (*Client) ConfigureDevice ¶
ConfigureDevice configures a WireGuard device by its interface name.
Because the zero value of some Go types may be significant to WireGuard for Config fields, only fields which are not nil will be applied when configuring a device.
If the device specified by name does not exist or is not a WireGuard device, an error is returned which can be checked using `errors.Is(err, os.ErrNotExist)`.
func (*Client) Device ¶
Device retrieves a WireGuard device by its interface name.
If the device specified by name does not exist or is not a WireGuard device, an error is returned which can be checked using `errors.Is(err, os.ErrNotExist)`.
func (*Client) Devices ¶
Devices retrieves all WireGuard devices on this system.
Source Files ¶
client.go doc.go os_linux.go
Directories ¶
Path | Synopsis |
---|---|
cmd | |
cmd/wgctrl | Command wgctrl is a testing utility for interacting with WireGuard via package wgctrl. |
internal | |
wgtypes | Package wgtypes provides shared types for the wgctrl family of packages. |
- Version
- v0.0.0-20241231184526-a9ab2273dd10 (latest)
- Published
- Dec 31, 2024
- Platform
- linux/amd64
- Imports
- 6 packages
- Last checked
- 1 month ago –
Tools for package owners.