Documentation
¶
Overview ¶
Package wgpeer defines the data structures used in the configuration file of this project.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Configuration ¶
type Configuration struct {
// IfaceName if the wireguard interface we are managing.
IfaceName string `json:"ifaceName"`
// Peers is the set of peers this node wants to communicate with.
Peers []Peer `json:"peers"`
}
Configuration is the unmarshalled form of the configuration file and contains all information of this node that are required for wgpeer.
func NewConfiguration ¶
func NewConfiguration(ifaceName string, peers ...Peer) Configuration
NewConfiguration creates a new Configuration instance with all values set.
type Peer ¶
type Peer struct {
// Public is the base64 encoded WG public key.
Public string `json:"public"`
// DNSName is the name of the DNS AAAA RR that contains the global endpint of the peer.
// Is refereshed continuously.
DNSName string `json:"dnsName"`
// MACs is the list of MAC addresses of the peer. This is used to determine if a link address
// belongs to it. Multiple MACs may be specified in case the node connects with multiple network
// cards (may it be with all at the same time or a single one out of the list).
// If multiple peer addresses are found the one belonging belonging to the earlier specified MAC
// is preferred.
MACs []string `json:"macs"`
}
Peer defines a peer this nodes wants to connect to vai wireguard.
Source Files
¶
- data.go
Click to show internal directories.
Click to hide internal directories.