etcd

package
v0.0.20 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const Name = "etcd"

Variables

This section is empty.

Functions

func List

func List() (dt map[string]*Client)

List etcd client list

Types

type Cfg

type Cfg struct {
	Endpoints            []string          `json:"endpoints"`
	AutoSyncInterval     time.Duration     `json:"interval"`
	DialTimeout          time.Duration     `json:"timeout"`
	DialKeepAliveTime    time.Duration     `json:"keepalive"`
	DialKeepAliveTimeout time.Duration     `json:"keepalive_timeout"`
	MaxCallSendMsgSize   int               `json:"max_send"`
	MaxCallRecvMsgSize   int               `json:"max_recv"`
	Username             string            `json:"username"`
	Name                 string            `json:"name"`
	Password             string            `json:"password"`
	DialOptions          []grpc.DialOption `json:"-"`
}

func GetDefaultCfg

func GetDefaultCfg() Cfg

func (Cfg) Build

func (t Cfg) Build() (c *clientv3.Client, err error)

type Client

type Client struct {
	*clientv3.Client
}

func Get

func Get(names ...string) *Client

Get 获取etcd client

Jump to

Keyboard shortcuts

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