config

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2022 License: GPL-3.0 Imports: 15 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, VPNLowProfile                  bool
	Blacklist                                  []string
	Concurrency                                int
	FrameTimeout                               string
	ChannelBufferSize, InterfaceMTU, PacketMTU int
	NAT                                        NAT
	Connection                                 Connection
	Discovery                                  Discovery
	Ledger                                     Ledger
}

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
	MaxConnections int
	MaxStreams     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.

Jump to

Keyboard shortcuts

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