Documentation ¶
Index ¶
- Constants
- Variables
- type Config
- type Op
- func (o *Op) Close() error
- func (o *Op) DelItem(prefix, k string)
- func (o *Op) Get(ctx context.Context, prefix string) (map[string]string, error)
- func (o *Op) GetWatch(prefix string) map[string]string
- func (o *Op) PutItem(prefix, k, v string)
- func (o *Op) Register(ctx context.Context, kvs map[string]string, ttl int64) error
- func (o *Op) Revoke() error
- func (o *Op) SetStateChangeCallback(prefix string, stateChange StateChangeCallBackFunc)
- func (o *Op) Watch(prefix string)
- type StateChangeCallBackFunc
Constants ¶
View Source
const (
DefaultSchema = "default"
)
Variables ¶
View Source
var ( ActionDel = "del" ActionPut = "put" )
View Source
var ( ErrConf = errors.New("conf error") ErrHasRegistered = errors.New("address has registed") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // etcd的地址 必须要 EndPoints []string `toml:"endpoints" json:"endpoints"` }
etcd的配置
type Op ¶
type Op struct { // 配置文件 C *Config Id clientv3.LeaseID Cli *clientv3.Client // contains filtered or unexported fields }
func (*Op) SetStateChangeCallback ¶
func (o *Op) SetStateChangeCallback(prefix string, stateChange StateChangeCallBackFunc)
Click to show internal directories.
Click to hide internal directories.