Documentation ¶
Index ¶
- Variables
- type Allocator
- func (a *Allocator) AbandonedInterfaces() ([]net.Interface, error)
- func (a *Allocator) AllocateIPNet() (net.IPNet, error)
- func (a *Allocator) AllocateInterface() (string, error)
- func (a *Allocator) AllocatePort() (int, error)
- func (a *Allocator) ReleaseIPNet(ipnet net.IPNet) error
- func (a *Allocator) ReleaseInterface(iface string) error
Constants ¶
This section is empty.
Variables ¶
var MaxConnections = 256
MaxConnections sets the limit to the maximum number of wireguard connections.
Functions ¶
This section is empty.
Types ¶
type Allocator ¶
type Allocator struct { Ifaces map[int]struct{} IPAddresses map[int]struct{} // contains filtered or unexported fields }
Allocator is mock wireguard resource handler. It will manage lists of network interfaces names, IP addresses and port for endpoints.
func NewAllocator ¶
NewAllocator creates new resource pool for wireguard connection.
func (*Allocator) AbandonedInterfaces ¶
AbandonedInterfaces returns a list of abandoned interfaces that exist in the system, but was not allocated by the Allocator.
func (*Allocator) AllocateIPNet ¶
AllocateIPNet provides available IP address for the wireguard connection.
func (*Allocator) AllocateInterface ¶
AllocateInterface provides available name for the wireguard network interface.
func (*Allocator) AllocatePort ¶
AllocatePort provides available UDP port for the wireguard endpoint.
func (*Allocator) ReleaseIPNet ¶
ReleaseIPNet releases IP address.
func (*Allocator) ReleaseInterface ¶
ReleaseInterface releases name for the wireguard network interface.