config

package
v0.18.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 28, 2022 License: Apache-2.0 Imports: 26 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	NetworkConfig, NetworkToken                string
	Address                                    string
	Router                                     string
	Interface                                  string
	Libp2pLogLevel, LogLevel                   string
	LowProfile, BootstrapIface                 bool
	Blacklist                                  []string
	Concurrency                                int
	FrameTimeout                               string
	ChannelBufferSize, InterfaceMTU, PacketMTU int
	NAT                                        NAT
	Connection                                 Connection
	Discovery                                  Discovery
	Ledger                                     Ledger
	Limit                                      ResourceLimit
	// PeerGuard (experimental)
	// enable peerguardian and add specific auth options
	PeerGuard PeerGuard
}

Config is the config struct for the node and the default EdgeVPN services It is used to generate opts for the node and the services before start.

func (Config) ToOpts

func (c Config) ToOpts(l *logger.Logger) ([]node.Option, []vpn.Option, error)

ToOpts returns node and vpn options from a configuration

func (Config) Validate

func (c Config) Validate() error

Validate returns error if the configuration is not valid

type Connection

type Connection struct {
	HolePunch bool
	AutoRelay bool

	AutoRelayDiscoveryInterval time.Duration
	RelayV1                    bool
	StaticRelays               []string
	OnlyStaticRelays           bool

	Mplex          bool
	MaxConnections int
}

Connection is the configuration section relative to the connection services

type Discovery

type Discovery struct {
	DHT, MDNS      bool
	BootstrapPeers []string
	Interval       time.Duration
}

Discovery allows to enable/disable discovery and set bootstrap peers

type Ledger

type Ledger struct {
	AnnounceInterval, SyncInterval time.Duration
	StateDir                       string
}

Ledger is the ledger configuration structure

type NAT

type NAT struct {
	Service   bool
	Map       bool
	RateLimit bool

	RateLimitGlobal, RateLimitPeer int
	RateLimitInterval              time.Duration
}

NAT is the structure relative to NAT configuration settings It allows to enable/disable the service and NAT mapping, and rate limiting too.

type PeerGuard added in v0.13.0

type PeerGuard struct {
	Enable      bool
	Relaxed     bool
	Autocleanup bool
	PeerGate    bool
	// AuthProviders in the freemap form:
	// ecdsa:
	//   private_key: "foo_bar"
	AuthProviders map[string]map[string]interface{}
	SyncInterval  time.Duration
}

type ResourceLimit added in v0.11.0

type ResourceLimit struct {
	FileLimit   string
	LimitConfig *rcmgr.LimitConfig
	Scope       string
	MaxConns    int
	StaticMin   int64
	StaticMax   int64
	Enable      bool
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL