config

package
v0.0.0-...-63f9e25 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2018 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLog

func GetLog() tlog.Logger

func SetLog

func SetLog(l1 tlog.Logger)

Types

type AppConfig

type AppConfig struct {
	Name     string
	Addr     string
	DbPath   string `mapstructure:"db_path" yaml:"db_path"`
	LogPath  string `mapstructure:"log_path" yaml:"log_path"`
	LogLevel string `mapstructure:"log_level" yaml:"log_level"`

	UdpPort int    `mapstructure:"udp_port" yaml:"udp_port"`
	UdpHost string `mapstructure:"udp_host" yaml:"udp_host"`

	HttpPort int    `mapstructure:"http_port" yaml:"http_port"`
	HttpHost string `mapstructure:"http_host" yaml:"http_host"`

	ExtIP string `mapstructure:"ext_ip" yaml:"ext_ip"`

	AdvertiseUdpAddr  string `mapstructure:"advertise_udp_addr" yaml:"advertise_udp_addr"`
	AdvertiseHttpAddr string `mapstructure:"advertise_http_addr" yaml:"advertise_http_addr"`

	Seeds []string `mapstructure:"seeds" yaml:"seeds"`
	PriV  string   `mapstructure:"priv" yaml:"priv"`
}

func DefaultAppConfig

func DefaultAppConfig() *AppConfig

type Config

type Config struct {
	// Top level options use an anonymous struct
	tcfg.BaseConfig `mapstructure:",squash"`

	// Options for services
	RPC       *tcfg.RPCConfig       `mapstructure:"rpc"`
	P2P       *tcfg.P2PConfig       `mapstructure:"p2p"`
	Mempool   *tcfg.MempoolConfig   `mapstructure:"mempool"`
	Consensus *tcfg.ConsensusConfig `mapstructure:"consensus"`
	TxIndex   *tcfg.TxIndexConfig   `mapstructure:"tx_index"`
	App       *AppConfig            `mapstructure:"app"`
}

func DefaultCfg

func DefaultCfg() *Config

func (*Config) SetRoot

func (cfg *Config) SetRoot(root string) *Config

SetRoot sets the RootDir for all Config structs

Jump to

Keyboard shortcuts

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