config

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ACLConfig

type ACLConfig struct {
	AllowPeers   []string `json:"allow_peers" yaml:"allow_peers"`
	AllowSubnets []string `json:"allow_subnets" yaml:"allow_subnets"`
}

type Config

type Config struct {
	PeerKey   string        `json:"peer_key" yaml:"peer_key"`
	P2PHost   string        `json:"p2p_host" yaml:"p2p_host"`
	ServePath string        `json:"serve_path" yaml:"serve_path"`
	Network   NetworkConfig `json:"network" yaml:"network"`
	DHT       DHTConfig     `json:"dht" yaml:"dht"`
	ACL       ACLConfig     `json:"acl" yaml:"acl"`
	Proxy     *ProxyConfig  `json:"proxy" yaml:"proxy"`
}

func Default

func Default() Config

func LoadConfig

func LoadConfig(cfgPath string) (Config, error)

type DHTConfig added in v1.2.0

type DHTConfig struct {
	DatastorePath  string   `json:"datastore_path" yaml:"datastore_path"`
	BootstrapPeers []string `json:"bootstrap_peers" yaml:"bootstrap_peers"`
}

type NetworkConfig

type NetworkConfig struct {
	EnableNAT     bool     `json:"enable_nat" yaml:"enable_nat"`
	ListenAddrs   []string `json:"listen_addrs" yaml:"listen_addrs"`
	ExternalAddrs []string `json:"external_addrs" yaml:"external_addrs"`
	Relays        []string `json:"relays" yaml:"relays"`
}

type ProxyConfig

type ProxyConfig struct {
	Addr       string `json:"addr" yaml:"addr"`
	ServerPeer string `json:"server_peer" yaml:"server_peer"`
}

Jump to

Keyboard shortcuts

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