Versions in this module Expand all Collapse all v1 v1.0.0 Mar 17, 2023 Changes in this version + const DefaultLogEncoding + const DefaultLogLevel + const DefaultLogLevelNacos + const DefaultLogOutput + const EnvNacosDataID + const EnvNacosGroup + const EnvNacosHost + const EnvNacosLogLevel + const EnvNacosNamespace + const EnvNacosPort + const EnvOtlpGrpcEndpoint + const FlagConfigFile + const FlagDumpConfig + var ErrEmptyConfig = errors.New("got empty config") + var ErrEmptyConfigFile = errors.New("error empty config file") + var ErrSkipProvider = errors.New("skip provider") + func DumpDemoCfg(cfg interface{}) + func TomlMarshalIndent(cfg interface{}) (string, error) + func TomlUnmarshaler(p []byte, v interface{}) error + func ValidateConfig(cfg interface{}) error + type Base struct + Log LogConfig + Metric bool + MetricGo bool + MetricProcess bool + OtlpGrpcEndpoint string + Profile bool + Tracing bool + func (b *Base) InitOtlpGrpcEndpointFromEnv() + func (b *Base) LogConfig() *LogConfig + type BaseConfigEmbedded interface + InitOtlpGrpcEndpointFromEnv func() + type BeforeInspectHook func(config interface{}) + type ChangeListener func(namespace, group, dataId, data string) + type ConfigLoader struct + func New(opts ...Option) *ConfigLoader + func (cl *ConfigLoader) Load(cfg interface{}) error + type FileProvider struct + DefaultConfigPath string + SkipIfDefaultNotExist bool + SkipIfPathEmpty bool + func (p *FileProvider) Config(helper *providerHelper) ([]byte, error) + func (p *FileProvider) Name() string + type FlagParseResult interface + ConfigFile func() string + DumpConfig func() bool + ShowHelp func() bool + ShowVersion func() bool + Usage func() func() + type FlagParser func() FlagParseResult + type FlagSet = pflag.FlagSet + type GoRedisConfig struct + Tracing bool + URI string + type InspectConfig func(config interface{}) error + type LogConfig struct + DisableStacktrace bool + Encoding LogEncoding + Level string + Output string + func (l *LogConfig) GetDisableStacktrace() bool + func (l *LogConfig) GetEncoding() string + func (l *LogConfig) GetInitialFields() map[string]interface{} + func (l *LogConfig) GetLevel() string + func (l *LogConfig) GetOutput() string + type LogEncoding string + const LogEncodingConsole + const LogEncodingJSON + type Logger interface + Debugw func(msg string, keysAndValues ...interface{}) + Errorw func(msg string, keysAndValues ...interface{}) + Fatalw func(msg string, keysAndValues ...interface{}) + Infow func(msg string, keysAndValues ...interface{}) + Warnw func(msg string, keysAndValues ...interface{}) + type LoggerConfig interface + GetDisableStacktrace func() bool + GetEncoding func() string + GetInitialFields func() map[string]interface{} + GetLevel func() string + GetOutput func() string + type MongoConfig struct + DB string + Tracing bool + URI string + type MysqlConfig struct + Dsn string + MaxIdleCount int + MaxOpenCount int + Tracing bool + type NacosClient struct + type NacosProvider struct + ChangeListener ChangeListener + LogLevel string + NacosLogger nacosLogger.Logger + func (p *NacosProvider) Config(helper *providerHelper) ([]byte, error) + func (p *NacosProvider) Name() string + type Option interface + func WithBeforeInspectHook(opt BeforeInspectHook) Option + func WithCustomUnmarshaler(opt Unmarshaler) Option + func WithDumpMarshalledConfig(opt bool) Option + func WithFlagParser(opt FlagParser) Option + func WithInspectConfig(opt InspectConfig) Option + func WithLogger(opt Logger) Option + func WithProviders(opt ...Provider) Option + func WithRegisterFlags(opt RegisterFlags) Option + func WithServiceName(opt string) Option + func WithServiceVersion(opt string) Option + func WithShortDescription(opt string) Option + func WithUsage(opt string) Option + type Provider interface + Config func(*providerHelper) ([]byte, error) + Name func() string + type RegisterFlags func(flag *FlagSet) + type TextProvider struct + ConfigText []byte + func (p *TextProvider) Config(helper *providerHelper) ([]byte, error) + func (p *TextProvider) Name() string + type Unmarshaler func(p []byte, v interface{}) error