Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewWgClient ¶
func NewWgClient() (*wgClient, error)
func NewWgClientFake ¶
Types ¶
type Client ¶
type Client interface {
// contains filtered or unexported methods
}
a simple interface that implements some of the methods of wgctrl.Client interface. a fake implementation is used for the unit tests
type Netlinker ¶
type Netlinker interface {
// contains filtered or unexported methods
}
func NewNetLinker ¶
func NewNetLinker() Netlinker
func NewNetLinkerFake ¶
type Wireguard ¶
type Wireguard struct { Client // client used to interact with the wireguard implementation in use Netlinker // the wireguard link living in the network namespace // contains filtered or unexported fields }
func (*Wireguard) AddPeer ¶
func (w *Wireguard) AddPeer(pubkey, endpointIP, listeningPort string, allowedIPs []string, keepAlive *time.Duration) error
it adds a new peer with the given configuration to the wireguard device
func (*Wireguard) GetDeviceName ¶
get name of the wireguard device
func (*Wireguard) GetLinkIndex ¶
get link index of the wireguard device
func (*Wireguard) RemovePeer ¶
it removes a peer with a given public key from the wireguard device
Click to show internal directories.
Click to hide internal directories.