Documentation ¶
Index ¶
- type Action
- type BaseSource
- func (bs *BaseSource) AddPath(path string, opts ...PathOption) error
- func (bs *BaseSource) All() (values map[string]interface{})
- func (bs *BaseSource) Client() client.Client
- func (bs *BaseSource) Close() error
- func (bs *BaseSource) Get(key string) (value interface{}, ok bool)
- func (bs *BaseSource) Keys() (keys []string)
- func (bs *BaseSource) Name() string
- func (bs *BaseSource) OnEvents(cb func([]*Event))
- func (bs *BaseSource) Priority() int
- func (bs *BaseSource) Set(key string, value interface{})
- type Event
- type Option
- type PathOption
- type Source
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseSource ¶
type BaseSource struct {
// contains filtered or unexported fields
}
func (*BaseSource) AddPath ¶
func (bs *BaseSource) AddPath(path string, opts ...PathOption) error
添加配置
func (*BaseSource) Client ¶
func (bs *BaseSource) Client() client.Client
func (*BaseSource) Close ¶
func (bs *BaseSource) Close() error
func (*BaseSource) Name ¶
func (bs *BaseSource) Name() string
func (*BaseSource) Priority ¶
func (bs *BaseSource) Priority() int
type Event ¶
type Option ¶
type Option func(opts *options)
func WithDeleted ¶
func WithDeleted() Option
func WithPrefix ¶
func WithPriority ¶
type PathOption ¶
type PathOption func(opts *pathOptions)
func WithPathParser ¶
func WithPathParser(parser parser.Parser) PathOption
func WithPathPriority ¶
func WithPathPriority(pri int) PathOption
func WithPathRequired ¶
func WithPathRequired() PathOption
func WithPathWatchDisabled ¶
func WithPathWatchDisabled() PathOption
type Source ¶
type Source interface { io.Closer Name() string Client() client.Client // 优先级 Priority() int // 获取所有的key Keys() (keys []string) // 获取所有的配置 All() (values map[string]interface{}) // 获取单个配置 Get(key string) (value interface{}, ok bool) // 设置配置 Set(key string, value interface{}) // 添加配置集合 AddPath(path string, opts ...PathOption) (err error) // 设置回调 OnEvents(cb func([]*Event)) }
Source 管理客户端的多个配置集合, 目前配置集没有优先级
Click to show internal directories.
Click to hide internal directories.