Documentation ¶
Overview ¶
Package wgcfg has types and a parser for representing WireGuard config.
Index ¶
Constants ¶
const EndpointDiscoSuffix = ".disco.tailscale:12345"
EndpointDiscoSuffix is appended to the hex representation of a peer's discovery key and is then the sole wireguard endpoint for peers with a non-zero discovery key. This form is then recognize by magicsock's CreateEndpoint.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { Name string PrivateKey wgkey.Private Addresses []netaddr.IPPrefix MTU uint16 DNS []netaddr.IP Peers []Peer }
Config is a WireGuard configuration. It only supports the set of things Tailscale uses.
func FromUAPI ¶
FromUAPI generates a Config from r. r should be generated by calling device.IpcGetOperation; it is not compatible with other uapi streams.
func (Config) Copy ¶
Copy makes a deep copy of Config. The result aliases no memory with the original.
func (Config) PeerWithKey ¶
PeerWithKey returns the Peer with key k and reports whether it was found.
type ParseError ¶
type ParseError struct {
// contains filtered or unexported fields
}
func (*ParseError) Error ¶
func (e *ParseError) Error() string