Versions in this module Expand all Collapse all v0 v0.0.3 Oct 7, 2023 v0.0.2 Sep 30, 2020 v0.0.1 Aug 5, 2020 Changes in this version + const KeyDefaultProfile + const KeyMailBase + const KeyMailSMTPBase + const KeyMailSMTPHost + const KeyMailSMTPOption + const KeyMailSMTPOptionInsecureSkipVerify + const KeyMailSMTPPass + const KeyMailSMTPPort + const KeyMailSMTPSender + const KeyMailSMTPUser + const KeyMongoAddrs + const KeyMongoAuthBase + const KeyMongoAuthDatabase + const KeyMongoAuthMechanism + const KeyMongoAuthPass + const KeyMongoAuthUser + const KeyMongoBase + const KeyMongoDatabase + const KeyMongoPerformAuth + const KeyMongoTimeoutSec + const KeyRedisBase + const KeyRedisDb + const KeyRedisHost + const KeyRedisPass + const KeyRedisPort + func CheckKeyIsExists(key string) bool + func GetBoolOrDefault(key string, or bool) bool + func GetFloat32OrDefault(key string, or float32) float32 + func GetFloat64OrDefault(key string, or float64) float64 + func GetInt64OrDefault(key string, or int64) int64 + func GetIntOrDefault(key string, or int) int + func GetStringOrDefault(key, or string) string + func GetStringSliceOrDefault(key string, or []string) []string + func LoadConfig(options ...Option) (err error) + func SetConfig(key string, value interface{}) error + type KeyBuilder struct + Base string + Class []string + Profile string + Src *viper.Viper + func NewKeyBuilder(base string, rest ...string) (ckb *KeyBuilder) + func (ckb *KeyBuilder) CheckKeyIsExists(key string) bool + func (ckb *KeyBuilder) Clone() *KeyBuilder + func (ckb *KeyBuilder) Current() string + func (ckb *KeyBuilder) GetBoolOrDefault(key string, or bool) bool + func (ckb *KeyBuilder) GetFloat32OrDefault(key string, or float32) float32 + func (ckb *KeyBuilder) GetFloat64OrDefault(key string, or float64) float64 + func (ckb *KeyBuilder) GetInt64OrDefault(key string, or int64) int64 + func (ckb *KeyBuilder) GetIntOrDefault(key string, or int) int + func (ckb *KeyBuilder) GetKey(key string) string + func (ckb *KeyBuilder) GetStringOrDefault(key string, or string) string + func (ckb *KeyBuilder) GetStringSliceOrDefault(key string, or []string) []string + func (ckb *KeyBuilder) Join(elems ...string) string + func (ckb *KeyBuilder) SubViper(key string) *viper.Viper + func (ckb *KeyBuilder) WithClass(c string) *KeyBuilder + func (ckb *KeyBuilder) WithProfile(p string) *KeyBuilder + type MongoAuth struct + Mechanism string + Password string + Source string + Username string + func GetDBMongoAuth(ckb *KeyBuilder) *MongoAuth + type MongoConfig struct + Addrs []string + Auth *MongoAuth + DefaultDb string + Timeout time.Duration + func LoadMongoConfig(profile string) (cfg *MongoConfig) + type Option struct + ConfigFallbackSearchPath string + ConfigSearchPath string + ConfigSearchPaths []string + DefaultConfigureName string + DefaultPath string + FileMustExists bool + Path string + Project string + func (c *Option) GetDefaultPath() string + func (c *Option) With(rhs *Option) *Option + type RedisConfig = struct + Db int + Host string + Pass string + Port int + func LoadRedisConfig(profile string) *RedisConfig + type SMTPConfig struct + Host string + Option SMTPConfigOption + Pass string + Port int + Sender string + User string + func LoadSMTPConfig(profile string) (cfg *SMTPConfig, err error) + type SMTPConfigOption struct + InsecureSkipVerify bool