wg

package
v0.4.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 10, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Interface

func Interface(name string, opts ...g.Option) *nodes.WireGuardInterface

func Peer

Types

type Address

type Address net.IPNet

func AddressIP

func AddressIP(fmts string, args ...any) Address

func AddressIPv4

func AddressIPv4(a, b, c, d byte, m int) Address

func (Address) Apply

func (addr Address) Apply(i *nodes.WireGuardInterface)

type AllowedIP

type AllowedIP net.IPNet

AllowedIPs specifies a list of allowed IP addresses in CIDR notation for this peer.

func AllowedIPStr

func AllowedIPStr(fmts string, args ...any) AllowedIP

func AllowedIPv4

func AllowedIPv4(a, b, c, d byte, m int) AllowedIP

func (AllowedIP) Apply

func (aip AllowedIP) Apply(p *nodes.WireGuardPeer)

type Endpoint

type Endpoint net.UDPAddr

Endpoint specifies the endpoint of this peer entry, if not nil.

func (Endpoint) Apply

func (ep Endpoint) Apply(p *nodes.WireGuardPeer)

type ListenPort

type ListenPort int

func (ListenPort) Apply

func (lp ListenPort) Apply(i *nodes.WireGuardInterface)

type PeerSelector

type PeerSelector nodes.WireGuardPeerSelectorFunc
var (
	FullMeshPeers PeerSelector = func(i, j *nodes.WireGuardInterface) bool { return true }
	NoPeers       PeerSelector = func(i, j *nodes.WireGuardInterface) bool { return false }
)

func (PeerSelector) Apply

func (ps PeerSelector) Apply(i *nodes.WireGuardInterface)

type PersistentKeepaliveInterval

type PersistentKeepaliveInterval time.Duration

PersistentKeepaliveInterval specifies the persistent keepalive interval for this peer, if not nil.

A non-nil value of 0 will clear the persistent keepalive interval.

func (PersistentKeepaliveInterval) Apply

type PresharedKey

type PresharedKey wgtypes.Key

PresharedKey specifies a peer's pre-shared key configuration, if not nil.

A non-nil, zero-value Key will clear the pre-shared key.

func (PresharedKey) Apply

func (pk PresharedKey) Apply(p *nodes.WireGuardPeer)

type PrivateKey

type PrivateKey crypto.Key

func (PrivateKey) Apply

func (pk PrivateKey) Apply(i *nodes.WireGuardInterface)

type PublicKey

type PublicKey wgtypes.Key

PublicKey specifies the public key of this peer. PublicKey is a mandatory field for all PeerConfigs.

func (PublicKey) Apply

func (pk PublicKey) Apply(p *nodes.WireGuardPeer)

type SetupKernelInterface

type SetupKernelInterface bool

func (SetupKernelInterface) Apply

type WriteConfigFile

type WriteConfigFile bool

func (WriteConfigFile) Apply

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL