Documentation ¶
Index ¶
Constants ¶
View Source
const (
DefaultTimeout = time.Minute
)
Variables ¶
View Source
var ForceDisableTls bool
Functions ¶
func InitGlobalProvider ¶
func InitGlobalProvider(provider *Provider)
func NewDefaultViperProto ¶
func NewDefaultViperProto() *viper.ViperProto
func SetGlobalProvider ¶
func SetGlobalProvider(provider *Provider)
Types ¶
type CompletedConfig ¶
type CompletedConfig struct {
// contains filtered or unexported fields
}
func (CompletedConfig) Apply ¶
Apply set options and something else as global init, act likes New but without Config's instance Apply usually called after Complete
type Config ¶
type Config struct { GetViper func() *viper.Viper // If set, overrides params below AppInfo *appinfo.Config Logs *logs.Config OpenTracer *opentrace.Config KeyCipher *pasta.Config Sql *sql.Config Redis *redis_.Config LevelDB *leveldb.Config Consul *consul.Config // contains filtered or unexported fields }
func NewViperConfig ¶ added in v0.0.17
NewViperConfig returns a Config struct with the global viper instance key representing a sub tree of this instance. NewViperConfig is case-insensitive for a key.
func (*Config) Complete ¶
func (c *Config) Complete() CompletedConfig
Complete fills in any fields not set that are required to have valid data and can be derived from other fields. If you're going to ApplyOptions, do that first. It's mutating the receiver. ApplyOptions is called inside.
type Provider ¶
type Provider struct { ConfigFile string Proto *viper_.ViperProto KeyCipher *pasta.Pasta SqlDB *sqlx.DB Redis redis.UniversalClient LevelDB *leveldb.ConsistentDB ServiceRegister *consul.ServiceRegister ServiceResolver *consul.ServiceResolver // contains filtered or unexported fields }
func GlobalProvider ¶
func GlobalProvider() *Provider
func (*Provider) ReloadForever ¶ added in v0.0.13
func (p *Provider) ReloadForever()
Click to show internal directories.
Click to hide internal directories.