config

package
v0.0.0-...-d40a6bc Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

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 assumed.

func FromReader

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

FromReader loads config from a reader instance.

func StorageFromFile

func StorageFromFile(path string, def *stores.StorageConfig) (*stores.StorageConfig, error)

func StorageFromReader

func StorageFromReader(reader io.Reader) (*stores.StorageConfig, error)

func WriteStorageFile

func WriteStorageFile(path string, config stores.StorageConfig) error

Types

type API

type API struct {
	ListenAddress       string
	RemoteListenAddress string
	Timeout             Duration
}

API contains configs for API endpoint

type Common

type Common struct {
	API API
}

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

type FullNode

type FullNode struct {
	Common
	Metrics Metrics
}

FullNode is a full node config

func DefaultFullNode

func DefaultFullNode() *FullNode

DefaultFullNode returns the default config

type Metrics

type Metrics struct {
	Nickname   string
	HeadNotifs bool
}

Jump to

Keyboard shortcuts

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