config

package
v0.2.10 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2020 License: Apache-2.0, MIT Imports: 8 Imported by: 38

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigComment

func ConfigComment(t interface{}) ([]byte, error)

func FromFile

func FromFile(path string, def interface{}) (interface{}, error)

FromFile loads config from a specified file overriding defaults specified in the def parameter. If file does not exist or is empty defaults are asummed.

func FromReader

func FromReader(reader io.Reader, def interface{}) (interface{}, error)

FromReader loads config from a reader instance.

Types

type API

type API struct {
	ListenAddress string
	Timeout       Duration
}

API contains configs for API endpoint

type Common

type Common struct {
	API    API
	Libp2p Libp2p
}

Common is common config between full node and miner

type Duration

type Duration time.Duration

Duration is a wrapper type for time.Duration for decoding and encoding from/to TOML

func (Duration) MarshalText

func (dur Duration) MarshalText() ([]byte, error)

func (*Duration) UnmarshalText

func (dur *Duration) UnmarshalText(text []byte) error

UnmarshalText implements interface for TOML decoding

type FullNode

type FullNode struct {
	Common
	Metrics Metrics
}

FullNode is a full node config

func DefaultFullNode

func DefaultFullNode() *FullNode

Default returns the default config

type Libp2p

type Libp2p struct {
	ListenAddresses []string
	BootstrapPeers  []string
	ProtectedPeers  []string

	ConnMgrLow   uint
	ConnMgrHigh  uint
	ConnMgrGrace Duration
}

Libp2p contains configs for libp2p

type Metrics

type Metrics struct {
	Nickname      string
	HeadNotifs    bool
	PubsubTracing bool
}

type SectorBuilder

type SectorBuilder struct {
	Path        string // TODO: remove // FORK (-ish)
	Storage     []fs.PathConfig
	WorkerCount uint

	DisableLocalPreCommit bool
	DisableLocalCommit    bool
}

type StorageMiner

type StorageMiner struct {
	Common

	SectorBuilder SectorBuilder
}

StorageMiner is a storage miner config

func DefaultStorageMiner

func DefaultStorageMiner() *StorageMiner

Jump to

Keyboard shortcuts

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