etcd

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

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 NewETCDDataSource

func NewETCDDataSource(prefix string) *DataSource

NewETCDDataSource ...

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) Reload

func (d *DataSource) Reload() error

Reload 重新启动

func (*DataSource) Stop

func (d *DataSource) Stop()

Stop 进程退出停止监听变化

func (*DataSource) StoreAppChanInfo

func (d *DataSource) StoreAppChanInfo(key, rawKey string, val *structs.ConfNode)

StoreAppChanInfo 监听到etcd的变化后,更新chan的信息

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL