Version: v0.0.2 Latest Latest

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

Go to latest
Published: Jul 11, 2021 License: MPL-2.0 Imports: 5 Imported by: 0




This section is empty.


This section is empty.


This section is empty.


type Address added in v0.0.2

type Address struct {
	// DNSName is the DNS name of this NodeAddress, if known.
	Name string

	// IP is the IP address of this NodeAddress, if known.
	IP netaddr.IP

	// Port is the port number for this NodeAddress, if known.
	Port uint16

	// LastReported indicates the time at which this address was last reported.
	LastReported time.Time

Address describes an IP or DNS address with optional Port.

func (*Address) Endpoint added in v0.0.2

func (a *Address) Endpoint(defaultPort uint16) (*net.UDPAddr, error)

Endpoint returns a UDP endpoint address for the Address, using the defaultPort if none is known.

func (*Address) Equal added in v0.0.2

func (a *Address) Equal(other *Address) bool

Equal indicates whether two addresses are equal.

func (*Address) EqualHost added in v0.0.2

func (a *Address) EqualHost(other *Address) bool

EqualHost indicates whether two addresses have the same host portion, ignoring the ports.

type Node

type Node struct {
	// Name is the human-readable identifier of this Node.
	// Usually, this is the kubernetes Node name.
	// It *should* generally be unique, but it is not required to be so.
	Name string `json:"name,omitempty"`

	// ID is the unique identifier for this Node.
	// Usually, this is the Wireguard Public Key of the Node.
	ID string `json:"id,omitempty"`

	// IP is the IP address of the Wireguard interface on this Node.
	IP netaddr.IP `json:"ip,omitempty"`

	// Addresses is a list of addresses for the Node.
	Addresses []*Address `json:"selfIPs,omitempty"`
	// contains filtered or unexported fields

Node describes a Wireguard Peer

func (*Node) AddAddresses added in v0.0.2

func (n *Node) AddAddresses(addresses ...*Address)

AddAddresses adds a set of addresses to a Node.

func (*Node) ExpireAddressesOlderThan added in v0.0.2

func (n *Node) ExpireAddressesOlderThan(maxAge time.Duration)

ExpireAddressesOlderThan removes addresses from the Node which have not been reported within the given timeframe.

Source Files

Jump to

Keyboard shortcuts

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