Documentation ¶
Index ¶
- type ConfigFile
- type IfaceConfig
- type KeyPair
- type NoOpWireguardInterface
- func (wg *NoOpWireguardInterface) AddPeer(publicKey string, presharedKey string, addressCIDR []string) error
- func (wg *NoOpWireguardInterface) Close() error
- func (wg *NoOpWireguardInterface) ListPeers() ([]wgtypes.Peer, error)
- func (wg *NoOpWireguardInterface) LoadConfig(config *ConfigFile) error
- func (wg *NoOpWireguardInterface) Ping() error
- func (wg *NoOpWireguardInterface) PublicKey() (string, error)
- func (wg *NoOpWireguardInterface) RemovePeer(publicKey string) error
- type Options
- type PeerConfig
- type WireGuardInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigFile ¶
type ConfigFile struct { Interface IfaceConfig Peers []PeerConfig `ini:"Peer,nonunique"` // contains filtered or unexported fields }
func ReadConfig ¶
func ReadConfig(path string) (*ConfigFile, error)
func (*ConfigFile) String ¶
func (c *ConfigFile) String() string
type IfaceConfig ¶
type KeyPair ¶
func NewKeyPair ¶
func NewKeyPair() KeyPair
type NoOpWireguardInterface ¶
type NoOpWireguardInterface struct { }
func (*NoOpWireguardInterface) AddPeer ¶
func (wg *NoOpWireguardInterface) AddPeer(publicKey string, presharedKey string, addressCIDR []string) error
func (*NoOpWireguardInterface) Close ¶
func (wg *NoOpWireguardInterface) Close() error
func (*NoOpWireguardInterface) ListPeers ¶
func (wg *NoOpWireguardInterface) ListPeers() ([]wgtypes.Peer, error)
func (*NoOpWireguardInterface) LoadConfig ¶
func (wg *NoOpWireguardInterface) LoadConfig(config *ConfigFile) error
func (*NoOpWireguardInterface) Ping ¶ added in v0.9.0
func (wg *NoOpWireguardInterface) Ping() error
func (*NoOpWireguardInterface) PublicKey ¶
func (wg *NoOpWireguardInterface) PublicKey() (string, error)
func (*NoOpWireguardInterface) RemovePeer ¶
func (wg *NoOpWireguardInterface) RemovePeer(publicKey string) error
type Options ¶
type Options struct { // InterfaceName will be the name of the network interface, this is required InterfaceName string // AllowKernelModule enables the usage of the WireGuard kernel module. // Falls back to userspace if creation fails. No effect on Windows or Darwin AllowKernelModule bool }
Options contains configuration options for the interface
type PeerConfig ¶
type WireGuardInterface ¶
type WireGuardInterface interface { LoadConfig(config *ConfigFile) error AddPeer(publicKey string, presharedKey string, addressCIDR []string) error ListPeers() ([]wgtypes.Peer, error) RemovePeer(publicKey string) error PublicKey() (string, error) Close() error Ping() error }
func New ¶
func New(interfaceName string) (WireGuardInterface, error)
New creates a wireguard interface and starts the userspace wireguard configuration api
func NewNoOpInterface ¶
func NewNoOpInterface() WireGuardInterface
func NewWithOpts ¶
func NewWithOpts(opts Options) (WireGuardInterface, error)
NewWithOpts creates a new network interface, needs to be enabled with WireGuardInterface.Up() afterwards. opts.Name is require and must be set to a unique interface name
Click to show internal directories.
Click to hide internal directories.