Documentation ¶
Index ¶
- Variables
- func LoadConfig(paths []string, remoteCfg *RemoteConfig) error
- func MustInitNacos(nacos NacosConf, register LoaderRegister)
- func MustLoadConfig(paths []string, remoteCfg *RemoteConfig)
- func RegisterLoader(filename string, loader func(*viper.Viper)) error
- type BasicAuth
- type Configure
- type LoaderRegister
- type LocalConfigure
- type NacosConf
- type NacosConfigure
- type RemoteConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrorConfigNotLoaded = fmt.Errorf("config not loaded") ErrorConfigInitFailed = fmt.Errorf("config init failed") )
Functions ¶
func LoadConfig ¶
func LoadConfig(paths []string, remoteCfg *RemoteConfig) error
func MustInitNacos ¶
func MustInitNacos(nacos NacosConf, register LoaderRegister)
func MustLoadConfig ¶
func MustLoadConfig(paths []string, remoteCfg *RemoteConfig)
Types ¶
type LoaderRegister ¶
type LoaderRegister interface {
Register() error
}
type LocalConfigure ¶
type LocalConfigure struct {
// contains filtered or unexported fields
}
func NewLocalConfigure ¶
func NewLocalConfigure(paths []string) *LocalConfigure
func (*LocalConfigure) GetConfig ¶
func (c *LocalConfigure) GetConfig(path string) (*viper.Viper, error)
func (*LocalConfigure) Init ¶
func (c *LocalConfigure) Init() error
func (*LocalConfigure) WatchConfig ¶
func (c *LocalConfigure) WatchConfig(path string, watchFn func(vip *viper.Viper)) error
type NacosConf ¶
type NacosConf struct { Enabled bool `json:"enabled" yaml:"enabled" mapstructure:"enabled"` Host string `json:"host" yaml:"host" mapstructure:"host"` Port uint64 `json:"port" yaml:"port" mapstructure:"port"` Username string `json:"username" yaml:"username" mapstructure:"username"` Password string `json:"password" yaml:"password" mapstructure:"password"` Paths []string `json:"paths" yaml:"paths" mapstructure:"paths"` }
type NacosConfigure ¶
type NacosConfigure struct {
// contains filtered or unexported fields
}
func NewNacosConfigure ¶
func NewNacosConfigure(paths []string, endpoint string, auth ...BasicAuth) *NacosConfigure
func (*NacosConfigure) GetConfig ¶
func (c *NacosConfigure) GetConfig(path string) (*viper.Viper, error)
func (*NacosConfigure) Init ¶
func (c *NacosConfigure) Init() error
func (*NacosConfigure) WatchConfig ¶
func (c *NacosConfigure) WatchConfig(path string, watchFn func(vip *viper.Viper)) error
Click to show internal directories.
Click to hide internal directories.