etcd

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2020 License: Apache-2.0 Imports: 12 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 {
	*clientv3.Client
	// contains filtered or unexported fields
}

Client ...

func (*Client) WatchPrefix

func (client *Client) WatchPrefix(ctx context.Context, prefix string) (*Watch, error)

NewWatch ...

type Config

type Config struct {
	Endpoints        []string      `json:"endpoints"`
	CertFile         string        `json:"certFile"`
	KeyFile          string        `json:"keyFile"`
	CaCert           string        `json:"caCert"`
	BasicAuth        bool          `json:"basicAuth"`
	UserName         string        `json:"userName"`
	Password         string        `json:"-"`
	ConnectTimeout   time.Duration `json:"connectTimeout"` // 连接超时时间
	Secure           bool          `json:"secure"`
	AutoSyncInterval time.Duration `json:"autoAsyncInterval"` // 自动同步member list的间隔
	TTL              int           // 单位:s
}

Config ...

func (*Config) Build

func (config *Config) Build() *Client

type Watch

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

Watch A watch only tells the latest revision

func (*Watch) C

func (w *Watch) C() chan *clientv3.Event

C ...

func (*Watch) IncipientKeyValues

func (w *Watch) IncipientKeyValues() []*mvccpb.KeyValue

IncipientKeyValues incipient key and values

Jump to

Keyboard shortcuts

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