Documentation
¶
Index ¶
Constants ¶
View Source
const ( LogLevelInfo = "info" LogLevelWarn = "warn" LogLevelError = "error" LogLevelDebug = "debug" NodeModeDNS = "dns" NodeModeSeed = "seed" NodeModeSuperNode = "supernode" NodeModeNode = "node" DefaultNodeAddress = "0.0.0.0" DefaultNodePort = 45050 DefaultNodeMode = NodeModeNode DefaultNodeKey = "Will be changed upon first run" DefaultAPIAddress = "127.0.0.1" DefaultAPIPort = 45505 DefaultDNSAddress = "127.0.0.1" DefaultDNSPort = 8080 )
Variables ¶
View Source
var ( ValidModes = map[string]bool{ NodeModeDNS: true, NodeModeSeed: true, NodeModeSuperNode: true, NodeModeNode: true, } ValidLogLevels = map[string]bool{ LogLevelInfo: true, LogLevelDebug: true, } )
Functions ¶
func WriteConfig ¶ added in v0.0.3
Types ¶
type APIConfig ¶
func DefaultAPIConfig ¶
func DefaultAPIConfig() *APIConfig
type BaseConfig ¶
type BaseConfig struct {
// The root directory for all data.
// This should be set in viper so it can unmarshal into this struct
ConfigDir string `mapstructure:"config_folder"`
//log level to set
LogLevel string `mapstructure:"log_level"`
// log file name
LogFolder string `mapstructure:"log_folder"`
// log file name
LogFile string `mapstructure:"log_file"`
// LevelDB path
DatabasePath string `mapstructure:"database_path"`
}
func DefaultBaseConfig ¶
func DefaultBaseConfig() BaseConfig
DefaultBaseConfig Default configurable base parameters.
type Config ¶
type Config struct {
// Top level options use an anonymous struct
BaseConfig `mapstructure:",squash"`
API *APIConfig `mapstructure:"api"`
Node *NodeConfig `mapstructure:"node"`
DNS *DNSConfig `mapstructure:"dns"`
}
func (*Config) GetConfigFile ¶
func (*Config) GetConfigFolder ¶
func (*Config) GetDatabaseFolder ¶
func (*Config) GetLogFile ¶
func (*Config) GetLogsFolder ¶
type DNSConfig ¶ added in v0.0.3
func DefaultDNSConfig ¶ added in v0.0.3
func DefaultDNSConfig() *DNSConfig
type NodeConfig ¶
type NodeConfig struct {
Address string `mapstructure:"address"`
Port int `mapstructure:"port"`
Mode string `mapstructure:"mode"`
PrivateKey string `mapstructure:"private-key"`
PublicKey string `mapstructure:"public-key"`
}
func DefaultNodeConfig ¶
func DefaultNodeConfig() *NodeConfig
Click to show internal directories.
Click to hide internal directories.