Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeviceConfig ¶
type DeviceConfig struct { IfaceName string `json:"iface_name"` MTU int `json:"mtu"` Subnet net.IPNet `json:"subnet"` PrivateKey string `json:"private_key"` ListenPort int `json:"listen_port"` DNSPort int `json:"dns_port,omitempty"` DNS []string `json:"dns"` // Used only for unix. DNSScriptDir string `json:"dns_script_dir"` Peer Peer `json:"peer"` ReplacePeers bool `json:"replace_peers,omitempty"` ProxyPort int `json:"proxy_port,omitempty"` }
DeviceConfig describes wireguard device configuration.
func (*DeviceConfig) Encode ¶
func (dc *DeviceConfig) Encode() string
Encode encodes device config into string representation which is used for userspace and kernel space wireguard configuration.
func (DeviceConfig) MarshalJSON ¶
func (dc DeviceConfig) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler interface to provide human readable configuration.
func (*DeviceConfig) UnmarshalJSON ¶
func (dc *DeviceConfig) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler interface to receive human readable configuration.
Click to show internal directories.
Click to hide internal directories.