Documentation
¶
Index ¶
- type AddrPort
- type Config
- func (o *Config) IPCConfig() (string, error)
- func (o *Config) IPCConfigWithoutDnsPeers() (string, error)
- func (o *Config) OnGlobalParam(paramName string) (func(*ini.Param) error, ini.SchemaRule)
- func (o *Config) OnSection(name string, _ string) (func() (ini.SectionSchema, error), ini.SchemaRule)
- func (o *Config) Rules() ini.ParserRules
- func (o *Config) Validate() error
- func (o *Config) WireGuardString() string
- type Interface
- type Peer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddrPort ¶
type AddrPort struct {
// contains filtered or unexported fields
}
AddrPort represents an address and port where the host part can be an IP address, a hostname, or some other string.
func AddrPortFrom ¶
type Config ¶
type Config struct {
Interface *Interface
Peers []*Peer
Others []*ini.Section
NamedPeer map[string]*Peer
}
Config represents the WireGuard configuration.
func (*Config) IPCConfig ¶
IPCConfig returns the Config in WireGuard IPC format.
For more information regarding this format, please refer to: https://www.wireguard.com/xplatform/#configuration-protocol
func (*Config) IPCConfigWithoutDnsPeers ¶
func (*Config) OnGlobalParam ¶
OnGlobalParam partly implements the ini.Schema interface.
func (*Config) OnSection ¶
func (o *Config) OnSection(name string, _ string) (func() (ini.SectionSchema, error), ini.SchemaRule)
OnSection partly implements the ini.Schema interface.
func (*Config) Rules ¶
func (o *Config) Rules() ini.ParserRules
Rules partly implements the ini.Schema interface.
func (*Config) WireGuardString ¶
type Interface ¶
type Interface struct {
PrivateKey *device.NoisePrivateKey
PublicKey *device.NoisePublicKey
ListenPort *uint16
Addresses []netip.Prefix
MTU *int
Others []*ini.Param
}
Interface represents the Interface section found in a WireGuard configuration file.
See also:
func (*Interface) AddressByIndex ¶ added in v0.0.10
func (*Interface) RequiredParams ¶
RequiredParams partly implements the ini.SectionSchema interface.
type Peer ¶
type Peer struct {
PublicKey *device.NoisePublicKey
Endpoint *AddrPort
AllowedIPs []netip.Prefix
PersistentKeepalive *uint64
Name string
Others []*ini.Param
}
Peer represents the Peer section found in a WireGuard configuration file.
See also:
func (*Peer) RequiredParams ¶
RequiredParams partly implements the ini.SectionSchema interface.