Documentation ¶
Index ¶
- Constants
- Variables
- type Client
- func (c *Client) CleanKV() error
- func (c *Client) Close()
- func (c *Client) Create(k string, v string) error
- func (c *Client) Delete(k string) error
- func (c *Client) Done() <-chan struct{}
- func (c *Client) Get(k string) (string, error)
- func (c *Client) GetChildren(k string) ([]string, []string, error)
- func (c *Client) GetChildrenKVList(k string) ([]string, []string, error)
- func (c *Client) GetCtx() context.Context
- func (c *Client) GetEndPoints() []string
- func (c *Client) GetRawClient() *clientv3.Client
- func (c *Client) RegisterTemp(k, v string) error
- func (c *Client) Update(k, v string) error
- func (c *Client) Valid() bool
- func (c *Client) Watch(k string) (clientv3.WatchChan, error)
- func (c *Client) WatchWithPrefix(prefix string) (clientv3.WatchChan, error)
- type Option
- type Options
Constants ¶
View Source
const ( // ConnDelay connection delay ConnDelay = 3 // MaxFailTimes max failure times MaxFailTimes = 15 // RegistryETCDV3Client client Name RegistryETCDV3Client = "etcd registry" // MetadataETCDV3Client client Name MetadataETCDV3Client = "etcd metadata" )
Variables ¶
View Source
var ( // ErrNilETCDV3Client raw client nil ErrNilETCDV3Client = perrors.New("etcd raw client is nil") // full describe the ERR // ErrKVPairNotFound not found key ErrKVPairNotFound = perrors.New("k/v pair not found") )
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client represents etcd client Configuration
func NewClient ¶
func NewClient(name string, endpoints []string, timeout time.Duration, heartbeat int) (*Client, error)
NewClient create a client instance with name, endpoints etc.
func NewConfigClient ¶
NewConfigClient create new Client
func (*Client) GetChildren ¶ added in v1.11.3
GetChildren return node children
func (*Client) GetChildrenKVList ¶
GetChildrenKVList gets children kv list by @k
func (*Client) GetEndPoints ¶ added in v1.11.3
GetEndPoints return etcd endpoints
func (*Client) GetRawClient ¶ added in v1.11.3
GetRawClient return etcd raw client
func (*Client) RegisterTemp ¶
RegisterTemp registers a temporary node
type Option ¶
type Option func(*Options)
Option will define a function of handling Options
func WithEndpoints ¶
WithEndpoints sets etcd client endpoints
func WithHeartbeat ¶
WithHeartbeat sets etcd client heartbeat
func WithTimeout ¶
WithTimeout sets etcd client timeout
Click to show internal directories.
Click to hide internal directories.