config

package
v0.0.0-...-765cc39 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2018 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FlagHome     = "home"
	FlagCertPath = "cert_path"
	FlagUseTLS   = "use_tls"
	FlagRPCPort  = "rpc_port"
)
View Source
const DefaultConfigFile = "chaind.toml"
View Source
const DefaultHome = "~/.chaind"

Variables

View Source
var ValidETHAPIs = sets.NewStringSet([]string{
	"admin",
	"db",
	"debug",
	"eth",
	"miner",
	"net",
	"personal",
	"shh",
	"txpool",
	"web3",
})

Functions

func ValidateConfig

func ValidateConfig(cfg *Config) error

Types

type Backend

type Backend struct {
	Type pkg.BackendType `mapstructure:"type"`
	URL  string          `mapstructure:"url"`
	Name string          `mapstructure:"name"`
	Main bool            `mapstructure:"main"`
}

type Config

type Config struct {
	Home             string            `mapstructure:"home"`
	CertPath         string            `mapstructure:"cert_path"`
	UseTLS           bool              `mapstructure:"use_tls"`
	EnablePrometheus bool              `mapstructure:"enable_prometheus"`
	ETHConfig        *ETH              `mapstructure:"eth"`
	RPCPort          int               `mapstructure:"rpc_port"`
	LogLevel         string            `mapstructure:"log_level"`
	LogAuditorConfig *LogAuditorConfig `mapstructure:"log_auditor"`
	RedisConfig      *RedisConfig      `mapstructure:"redis"`
	Backends         []Backend         `mapstructure:"backend"`
	Master           bool              `mapstructure:"master"`
}

func ReadConfig

func ReadConfig(allowDefaults bool) (Config, error)

type ETH

type ETH struct {
	APIs []string `mapstructure:"apis"`
	Path string   `mapstructure:"path"`
}

type LogAuditorConfig

type LogAuditorConfig struct {
	LogFile string `mapstructure:"log_file"`
}

type RedisConfig

type RedisConfig struct {
	URL      string `mapstructure:"url"`
	Password string `mapstructure:"password"`
	DB       int    `mapstructure:"db"`
}

Jump to

Keyboard shortcuts

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