config

package
v0.0.0-...-105113c Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultConfigFile is the filename of the configuration file
	DefaultConfigFile = "config"

	SwarmPort = "3700"
)

Variables

This section is empty.

Functions

func Filename

func Filename(configroot string) (string, error)

Filename returns the configuration file path given a configuration root directory. If the configuration root directory is empty, use the default one

func Marshal

func Marshal(value interface{}) ([]byte, error)

Marshal configuration with JSON

func ToMap

func ToMap(conf *Config) (map[string]interface{}, error)

Types

type Addresses

type Addresses struct {
	Swarm []string // addresses for the swarm to listen on
}

Addresses stores the (string) multiaddr addresses for the node.

type Config

type Config struct {
	Identity   Identity  // local node's peer identity
	Addresses  Addresses // local node's addresses
	Bootstrap  []string
	DeviceName string
	ConnMgr    ConnMgr
	// ReprovideInterval sets how often to reprovide records to the DHT
	ReprovideInterval time.Duration
}

Config wraps configuration options for the Peer.

func ConfigInit

func ConfigInit(nbits int) (*Config, error)

func FromMap

func FromMap(v map[string]interface{}) (*Config, error)

type ConnMgr

type ConnMgr struct {
	LowWater  int
	HighWater int
}

type Identity

type Identity struct {
	PeerID  string
	PrivKey string `json:",omitempty"`
}

Identity tracks the configuration of the local node's identity.

Jump to

Keyboard shortcuts

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