Documentation ¶
Index ¶
- Variables
- type ConfDataSourceEtcd
- type DataSource
- func (d *DataSource) AppConfigScanner() []*structs.ConfNode
- func (d *DataSource) GetRawValues(ctx echo.Context, rawKey string) (map[string]string, error)
- func (d *DataSource) GetValues(ctx echo.Context, keys ...string) (map[string]string, error)
- func (d *DataSource) ListenAppConfig(ctx echo.Context, key string) chan *structs.ConfNode
- func (d *DataSource) Reload() error
- func (d *DataSource) Stop()
- func (d *DataSource) StoreAppChanInfo(key, rawKey string, val *structs.ConfNode)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrEnvPass ... ErrEnvPass = errors.New("env pass") )
Functions ¶
This section is empty.
Types ¶
type ConfDataSourceEtcd ¶ added in v0.1.0
type ConfDataSourceEtcd struct { Enable bool // 是否开启用该数据源 Secure bool EndPoints []string `json:"endpoints"` // 注册中心etcd节点信息 }
ConfDataSourceEtcd ETCD dataSource config
type DataSource ¶
type DataSource struct {
// contains filtered or unexported fields
}
DataSource etcd conf datasource
func (*DataSource) AppConfigScanner ¶
func (d *DataSource) AppConfigScanner() []*structs.ConfNode
AppConfigScanner 初始化加载实例配置
func (*DataSource) GetRawValues ¶
func (d *DataSource) GetRawValues(ctx echo.Context, rawKey string) (map[string]string, error)
func (*DataSource) GetValues ¶
func (d *DataSource) GetValues(ctx echo.Context, keys ...string) (map[string]string, error)
GetValues ...
func (*DataSource) ListenAppConfig ¶
func (d *DataSource) ListenAppConfig(ctx echo.Context, key string) chan *structs.ConfNode
ListenAppConfig listen the app config change
func (*DataSource) StoreAppChanInfo ¶
func (d *DataSource) StoreAppChanInfo(key, rawKey string, val *structs.ConfNode)
StoreAppChanInfo 监听到etcd的变化后,更新chan的信息
Click to show internal directories.
Click to hide internal directories.