Documentation ¶
Index ¶
- Constants
- func DefaultConfig() (conf *viper.Viper)
- func GenChainID() string
- func InitConfig(root, chainID string, setConf *viper.Viper) (*viper.Viper, error)
- func InitRuntime(root string, chainId string, setConf *viper.Viper) error
- func ReadConfig(root string) (*viper.Viper, error)
- func SetDefaults(runtime string, conf *viper.Viper) *viper.Viper
- type Config
- type MapConfig
- func (cfg *MapConfig) Get(key string) interface{}
- func (cfg *MapConfig) GetBool(key string) bool
- func (cfg *MapConfig) GetConfig(key string) Config
- func (cfg *MapConfig) GetFloat64(key string) float64
- func (cfg *MapConfig) GetInt(key string) int
- func (cfg *MapConfig) GetMap(key string) map[string]interface{}
- func (cfg *MapConfig) GetMapString(key string) map[string]string
- func (cfg *MapConfig) GetString(key string) string
- func (cfg *MapConfig) GetStringSlice(key string) []string
- func (cfg *MapConfig) GetTime(key string) time.Time
- func (cfg *MapConfig) IsSet(key string) bool
- func (cfg *MapConfig) Set(key string, value interface{})
- func (cfg *MapConfig) SetDefault(key string, value interface{})
- func (cfg *MapConfig) SetRequired(key string)
Constants ¶
View Source
const ( RUNTIME_ENV = "ANGINE_RUNTIME" DEFAULT_RUNTIME = ".genesis" DATADIR = "data" ARCHIVEDIR = "data/archive" CONFIGFILE = "config.toml" )
View Source
const CONFIGTPL = `` /* 299-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
func DefaultConfig ¶
func GenChainID ¶
func GenChainID() string
func InitRuntime ¶
InitRuntime makes all the necessary directorys for angine's runtime and generate the config template for you if it is not there already
func ReadConfig ¶
ReadConfig returns a ready-to-go config instance with all defaults filled in
Types ¶
type Config ¶
type Config interface { Get(key string) interface{} GetBool(key string) bool GetFloat64(key string) float64 GetInt(key string) int GetString(key string) string GetStringSlice(key string) []string GetTime(key string) time.Time GetMap(key string) map[string]interface{} GetMapString(key string) map[string]string GetConfig(key string) Config IsSet(key string) bool Set(key string, value interface{}) SetDefault(key string, value interface{}) }
type MapConfig ¶
type MapConfig struct {
// contains filtered or unexported fields
}
func NewMapConfig ¶
func ReadMapConfigFromFile ¶
func (*MapConfig) GetFloat64 ¶
func (*MapConfig) GetStringSlice ¶
func (*MapConfig) SetDefault ¶
func (*MapConfig) SetRequired ¶
Click to show internal directories.
Click to hide internal directories.