etcd

package
v1.3.4 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2024 License: LGPL-3.0 Imports: 5 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
}

func (*Client) AcquireLock

func (c *Client) AcquireLock(lockName string) (*concurrency.Mutex, *concurrency.Session, error)

AcquireLock 分布式锁

func (*Client) Close

func (c *Client) Close() error

Close 关闭连接

func (*Client) Connect

func (c *Client) Connect(endpoints []string, dialTimeout time.Duration) error

Connect 建立连接

func (*Client) CreateLease

func (c *Client) CreateLease(ttl int64) (clientv3.LeaseID, error)

CreateLease 租约管理

func (*Client) Get

func (c *Client) Get(key string, timeout time.Duration) (string, error)

Get 读取

func (*Client) KeepAliveLease

func (c *Client) KeepAliveLease(id clientv3.LeaseID) error

KeepAliveLease 保持租约激活

func (*Client) ListMembers

func (c *Client) ListMembers() error

ListMembers 成员管理

func (*Client) Put

func (c *Client) Put(key, value string, timeout time.Duration) error

Put 放置/更新

func (*Client) ReleaseLock

func (c *Client) ReleaseLock(m *concurrency.Mutex, s *concurrency.Session) error

ReleaseLock 释放锁

func (*Client) Txn

func (c *Client) Txn() error

Txn 事务

func (*Client) WatchKey added in v1.3.4

func (c *Client) WatchKey(key string)

WatchKey 监听一个key

Jump to

Keyboard shortcuts

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