Documentation ¶
Index ¶
- type EtcdConfiger
- func (e *EtcdConfiger) DIY(key string) (interface{}, error)
- func (e *EtcdConfiger) GetSection(section string) (map[string]string, error)
- func (e *EtcdConfiger) OnChange(key string, fn func(value string))
- func (e *EtcdConfiger) SaveConfigFile(filename string) error
- func (e *EtcdConfiger) Set(key, val string) error
- func (e *EtcdConfiger) Sub(key string) (config.Configer, error)
- func (e *EtcdConfiger) Unmarshaler(prefix string, obj interface{}, opt ...config.DecodeOption) error
- type EtcdConfigerProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EtcdConfiger ¶
type EtcdConfiger struct { config.BaseConfiger // contains filtered or unexported fields }
func (*EtcdConfiger) DIY ¶
func (e *EtcdConfiger) DIY(key string) (interface{}, error)
DIY return the original response from etcd be careful when you decide to use this
func (*EtcdConfiger) GetSection ¶
func (e *EtcdConfiger) GetSection(section string) (map[string]string, error)
GetSection in this implementation, we use section as prefix
func (*EtcdConfiger) OnChange ¶
func (e *EtcdConfiger) OnChange(key string, fn func(value string))
TODO remove this before release v2.0.0
func (*EtcdConfiger) SaveConfigFile ¶
func (e *EtcdConfiger) SaveConfigFile(filename string) error
func (*EtcdConfiger) Set ¶
func (e *EtcdConfiger) Set(key, val string) error
Set do nothing and return an error I think write data to remote config center is not a good practice
func (*EtcdConfiger) Sub ¶
func (e *EtcdConfiger) Sub(key string) (config.Configer, error)
Sub return an sub configer.
func (*EtcdConfiger) Unmarshaler ¶
func (e *EtcdConfiger) Unmarshaler(prefix string, obj interface{}, opt ...config.DecodeOption) error
Unmarshaler is not very powerful because we lost the type information when we get configuration from etcd for example, when we got "5", we are not sure whether it's int 5, or it's string "5" TODO(support more complicated decoder)
type EtcdConfigerProvider ¶
type EtcdConfigerProvider struct{}
Click to show internal directories.
Click to hide internal directories.