Documentation
¶
Index ¶
- func ConfigComment(t interface{}) ([]byte, error)
- func CoverConfig(path string, config *Config) error
- func GetStringSlicePreserveString(cfg Provider, key string) []string
- type APIConfig
- type APIRegisterHubConfig
- type Config
- type CryptoFactor
- type DBConfig
- type JWTConfig
- type MetricsConfig
- type Provider
- type SignFilter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigComment ¶
ConfigComment parse toml config to bytes
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 APIRegisterHubConfig ¶ added in v1.2.0
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"` SignFilter *SignFilter `json:"SignFilter"` APIRegisterHub *APIRegisterHubConfig `json:"WalletEvent"` }
full config
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"` }
aes
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 SignFilter ¶ added in v1.9.0
type SignFilter struct {
Expr string `json:"expr"`
}
Click to show internal directories.
Click to hide internal directories.