config

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client 是etcd客户端(v3)的包装器

func NewEtcdClient

func NewEtcdClient(machines []string, cert, key, caCert string, basicAuth bool, username string, password string) (*Client, error)

NewEtcdClient 返回一个*etcd.Client(v3)并与命名机器建立连接.

func (*Client) Close

func (c *Client) Close() error

func (*Client) GetValues

func (c *Client) GetValues(keys []string) (map[string]string, error)

GetValues 查询etcd中以keys为前缀的值.

func (*Client) WatchPrefix

func (c *Client) WatchPrefix(prefix string, keys []string, waitIndex uint64, stopChan chan bool) (uint64, error)

type Watch

type Watch struct {
	// contains filtered or unexported fields
}

Watch 守护者只显示最新版本

func (*Watch) WaitNext

func (w *Watch) WaitNext(ctx context.Context, lastRevision int64, notify chan<- int64)

WaitNext 等待修订版本大于lastRevision

Jump to

Keyboard shortcuts

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