etcd

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const DesKey = "aluka-7!"
View Source
const Namespace = "/system"

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientConfig

type ClientConfig struct {
	Endpoints   []string `json:"endpoints"`   // etcd节点列表
	DialTimeout int64    `json:"dialTimeout"` // 超时时间
	Username    string   `json:"username"`    // 账号
	Password    string   `json:"password"`    // 密码
}

func NewStoreConfig

func NewStoreConfig() (conf ClientConfig)

NewStoreConfig 提供给所有业务系统使用的配置管理引擎,所有业务系统/中间件的可变配置通过集中配置中心进行统一

type EtcdServer

type EtcdServer interface {
	Client() *clientv3.Client
	Set(ctx context.Context, path []string, value string) error
	SetExpires(ctx context.Context, path []string, value string, ttl int64) error
	Delete(ctx context.Context, path []string) error
	Clazz(ctx context.Context, path []string, clazz interface{}) error
	Watch(ctx context.Context, path []string, clazz interface{}) error
	Lock(ctx context.Context, path []string, ttl int64) (m *concurrency.Mutex, s *concurrency.Session, err error)
}

func DefaultEngine

func DefaultEngine() EtcdServer

func Engine

func Engine(conf ClientConfig) EtcdServer

Engine 获取配置管理引擎的唯一实例。

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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