Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigComment ¶
func CoverConfig ¶
func GetStringSlicePreserveString ¶
GetStringSlicePreserveString returns a string slice from the given config and key. It differs from the GetStringSlice method in that if the config value is a string, we do not attempt to split it into fields.
Types ¶
type APIConfig ¶
type APIConfig struct {
ListenAddress string `json:"listenAddress"`
}
rpc server address listen
type Config ¶
type Config struct { API *APIConfig `json:"API"` DB *DBConfig `json:"DB" binding:"required"` Metrics *MetricsConfig `json:"METRICS"` JWT *JWTConfig `json:"JWT"` Factor *CryptoFactor `json:"FACTOR"` Strategy *StrategyConfig `json:"STRATEGY"` }
full config
func DecodeConfig ¶
type CryptoFactor ¶
type CryptoFactor struct { // ScryptN is the N parameter of Scrypt encryption algorithm, using 256MB // memory and taking approximately 1s CPU time on a modern processor. ScryptN int `json:"scryptN"` // ScryptP is the P parameter of Scrypt encryption algorithm, using 256MB // memory and taking approximately 1s CPU time on a modern processor. ScryptP int `json:"scryptP"` }
type DBConfig ¶
type DBConfig struct { Conn string `json:"conn" binding:"required"` Type string `json:"type" binding:"required"` DebugMode bool `json:"debugMode" binding:"required"` }
for keystore
type MetricsConfig ¶
metrics
type Provider ¶
type Provider interface { GetString(key string) string GetInt(key string) int GetBool(key string) bool GetStringMap(key string) map[string]interface{} GetStringMapString(key string) map[string]string GetStringSlice(key string) []string Get(key string) interface{} Set(key string, value interface{}) IsSet(key string) bool WatchConfig() OnConfigChange(run func(in fsnotify.Event)) Unmarshal(rawVal interface{}, opts ...viper.DecoderConfigOption) error UnmarshalKey(key string, rawVal interface{}, opts ...viper.DecoderConfigOption) error }
func FromConfigString ¶
FromConfigString creates a config from the given YAML, JSON or TOML config. This is useful in tests.
type StrategyConfig ¶
Click to show internal directories.
Click to hide internal directories.