Versions in this module Expand all Collapse all v0 v0.4.6 Dec 4, 2023 v0.4.5 Oct 10, 2023 v0.4.4 Aug 14, 2023 v0.4.3 Aug 14, 2023 Changes in this version + const DefaultRouteTable + const DefaultSocketPath + const EphemeralPortMax + const EphemeralPortMin + var DefaultBackends = []url.URL + var DefaultICEURLs = []url.URL + var DefaultPrefixes = []string + var DefaultSettings = Settings + var OutputFormats = []OutputFormat + var RuntimeConfigFile = "/var/lib/cunicu.runtime.yaml" + func DecoderConfig(result any) *mapstructure.DecoderConfig + func ExtractInterfaceOrder(buf []byte) ([]string, error) + func InitDefaults() error + func Map(v any, tagName string) map[string]any + type BaseHookSetting struct + Type string + type ChangedHandler interface + OnConfigChanged func(key string, oldValue, newValue any) error + type Config struct + Domains []string + Files []string + InterfaceOrder []string + InterfaceOrderCLI []string + Providers []koanf.Provider + Runtime *runtimeSource + Sources []Source + Watch bool + func New(flags *pflag.FlagSet) *Config + func (c *Config) AddProvider(provider koanf.Provider) error + func (c *Config) AddSource(source Source) error + func (c *Config) Init(args []string) (err error) + func (c *Config) InterfaceFilter(name string) bool + func (c *Config) InterfaceOrderByName(name string) []string + func (c *Config) InterfaceSettings(name string) (cfg *InterfaceSettings) + func (c *Config) InvokeChangedHandlers(key string, change types.Change) error + func (c *Config) Marshal(wr io.Writer) error + func (c *Config) ReloadAllSources() (map[string]types.Change, error) + func (c *Config) Update(sets map[string]any) (map[string]types.Change, error) + type ExecHookSetting struct + Args []string + Command string + Env map[string]string + Stdin bool + type HookSetting any + type ICESettings struct + CandidateTypes []ice.CandidateType + CheckInterval time.Duration + DisconnectedTimeout time.Duration + FailedTimeout time.Duration + InsecureSkipVerify bool + InterfaceFilter string + KeepaliveInterval time.Duration + Lite bool + MDNS bool + MaxBindingRequests int + NAT1to1IPs []string + NetworkTypes []ice.NetworkType + Password string + PortRange PortRangeSettings + RelayTCP *bool + RelayTLS *bool + RestartTimeout time.Duration + URLs []url.URL + Username string + func (s *ICESettings) HasCandidateType(ct ice.CandidateType) bool + func (s *ICESettings) HasNetworkType(nt ice.NetworkType) bool + type InterfaceSettings struct + Addresses []net.IPNet + Blacklist []crypto.Key + Community crypto.KeyPassphrase + DNS []net.IPAddr + DiscoverEndpoints bool + DiscoverPeers bool + Domain string + ExtraHosts map[string][]net.IPAddr + FirewallMark int + Hooks []HookSetting + HostName string + ICE ICESettings + ListenPort *int + ListenPortRange *PortRangeSettings + MTU int + Networks []net.IPNet + Peers map[string]PeerSettings + PortForwarding bool + Prefixes []net.IPNet + PrivateKey crypto.Key + RoutingTable int + SyncConfig bool + SyncHosts bool + SyncRoutes bool + UserSpace bool + WatchConfig bool + WatchRoutes bool + Whitelist []crypto.Key + func NewInterfaceSettingsFromConfig(c *wg.Config) (*InterfaceSettings, error) + func (c *InterfaceSettings) AgentConfig(ctx context.Context, peer *crypto.Key) (*ice.AgentConfig, error) + func (c *InterfaceSettings) AgentURLs(ctx context.Context, pk *crypto.Key) ([]*stun.URI, error) + func (c *InterfaceSettings) Check() error + type LocalFileProvider struct + func NewLocalFileProvider(path string) *LocalFileProvider + func (p *LocalFileProvider) Order() []string + func (p *LocalFileProvider) ReadBytes() ([]byte, error) + type LogSettings struct + Banner bool + Color string + File string + Level string + Rules []string + type LookupProvider struct + func NewLookupProvider(domain string) *LookupProvider + func (p *LookupProvider) Read() (map[string]any, error) + func (p *LookupProvider) ReadBytes() ([]byte, error) + func (p *LookupProvider) SubProviders() []koanf.Provider + func (p *LookupProvider) Version() any + func (p *LookupProvider) Watch(cb func(event any, err error)) error + type Meta struct + Fields map[string]*Meta + Parent *Meta + Type reflect.Type + func Metadata() *Meta + func (m *Meta) AddChangedHandler(key string, h ChangedHandler) + func (m *Meta) CompletionOptions() []string + func (m *Meta) InvokeChangedHandlers(key string, change types.Change) error + func (m *Meta) Keys() []string + func (m *Meta) Lookup(key string) *Meta + func (m *Meta) Parse(str string) (any, error) + type Orderable interface + Order func() []string + type OutputFormat string + const OutputFormatHuman + const OutputFormatJSON + const OutputFormatLogger + func (f *OutputFormat) Set(str string) error + func (f *OutputFormat) Type() string + func (f *OutputFormat) UnmarshalText(text []byte) error + func (f OutputFormat) MarshalText() ([]byte, error) + func (f OutputFormat) String() string + type PeerSettings struct + AllowedIPs []net.IPNet + Endpoint string + PersistentKeepaliveInterval time.Duration + PresharedKey crypto.Key + PresharedKeyPassphrase crypto.KeyPassphrase + PublicKey crypto.Key + type PortRangeSettings struct + Max int + Min int + type RPCSettings struct + Socket string + Wait bool + type RemoteFileProvider struct + func NewRemoteFileProvider(u *url.URL) *RemoteFileProvider + func (p *RemoteFileProvider) Order() []string + func (p *RemoteFileProvider) Read() (map[string]interface{}, error) + func (p *RemoteFileProvider) ReadBytes() ([]byte, error) + func (p *RemoteFileProvider) Version() any + type Settings struct + Backends []url.URL + DefaultInterfaceSettings InterfaceSettings + Experimental bool + Interfaces map[string]InterfaceSettings + Log LogSettings + RPC RPCSettings + WatchInterval time.Duration + func (s *Settings) Check() error + type Source interface + Config func() *koanf.Koanf + Load func() error + Order func() []string + type StructsProvider struct + func NewStructsProvider(v any, t string) *StructsProvider + func (p *StructsProvider) Read() (map[string]any, error) + func (p *StructsProvider) ReadBytes() ([]byte, error) + type SubProvidable interface + SubProviders func() []koanf.Provider + type Versioned interface + Version func() any + type Watchable interface + Watch func(cb func(event any, err error)) error + type WebHookSetting struct + Headers map[string]string + Method string + URL url.URL + type WireGuardProvider struct + func NewWireGuardProvider() *WireGuardProvider + func (p *WireGuardProvider) Order() []string + func (p *WireGuardProvider) Read() (map[string]interface{}, error) + func (p *WireGuardProvider) ReadBytes() ([]byte, error)