Documentation ¶
Index ¶
- Constants
- Variables
- func FromApollo(apolloConfig *apollo.ApolloBaseConfig, conf []interface{}) error
- func FromEnv(logLevel logrus.Level, confPrefix string, conf []interface{}) error
- func FromEtcd(config *etcd.BaseConfig, prefix string, conf []any) error
- func FromNacos(logLevel logrus.Level, nacosConfig *nacos.BaseConfig, prefix string, ...) error
- func GetDefaultFromEnv(confPrefix string, conf []interface{}) []envconfig.EnvVar
- func Initialize(config ...any)
- type ConfigManager
- type Initializer
- type Options
Constants ¶
View Source
const (
DefaultConfigPath = "./configs"
)
Variables ¶
View Source
var (
ErrConfigCenterOptionsType = errors.New("config center options type error")
)
Functions ¶
func FromApollo ¶
func FromApollo(apolloConfig *apollo.ApolloBaseConfig, conf []interface{}) error
func GetDefaultFromEnv ¶
func Initialize ¶
func Initialize(config ...any)
Types ¶
type ConfigManager ¶
type ConfigManager struct {
// contains filtered or unexported fields
}
ConfigManager 配置自动装配工具,依照优先读取本地配置文件、环境变量、配置中心的顺序进行配置的自动装配
func NewConfigManager ¶
func NewConfigManager(opt Options, configs ...any) *ConfigManager
NewConfigManager 创建配置自动装配工具
func (*ConfigManager) Autoconf ¶
func (m *ConfigManager) Autoconf() error
func (*ConfigManager) MustAutoconf ¶
func (m *ConfigManager) MustAutoconf()
type Initializer ¶
type Initializer interface {
Init()
}
Click to show internal directories.
Click to hide internal directories.