Documentation ¶
Index ¶
- type Client
- func (c *Client) AcquireLock(lockName string) (*concurrency.Mutex, *concurrency.Session, error)
- func (c *Client) Close() error
- func (c *Client) Connect() error
- func (c *Client) CreateLease(ttl int64) (cliv3.LeaseID, error)
- func (c *Client) Get(key string, prefix bool) (map[string]string, error)
- func (c *Client) KeepAliveLease(id cliv3.LeaseID) error
- func (c *Client) ListMembers() error
- func (c *Client) Put(key, value string) error
- func (c *Client) RegisterService(serviceName, serviceAddr string, ttl int64) (cliv3.LeaseID, error)
- func (c *Client) ReleaseLock(m *concurrency.Mutex, s *concurrency.Session) error
- func (c *Client) Txn() error
- func (c *Client) Watch(key string, prefix bool)
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) CreateLease ¶
CreateLease 租约管理
func (*Client) KeepAliveLease ¶
KeepAliveLease 保持租约激活
func (*Client) RegisterService ¶
RegisterService 注册服务
func (*Client) ReleaseLock ¶
func (c *Client) ReleaseLock(m *concurrency.Mutex, s *concurrency.Session) error
ReleaseLock 释放锁
Click to show internal directories.
Click to hide internal directories.