Documentation
¶
Index ¶
- type Client
- func (c *Client) AcquireLock(lockName string) (*concurrency.Mutex, *concurrency.Session, error)
- func (c *Client) Close() error
- func (c *Client) Connect(endpoints []string, dialTimeout time.Duration) error
- func (c *Client) CreateLease(ttl int64) (clientv3.LeaseID, error)
- func (c *Client) Get(key string, timeout time.Duration) (string, error)
- func (c *Client) KeepAliveLease(id clientv3.LeaseID) error
- func (c *Client) ListMembers() error
- func (c *Client) Put(key, value string, timeout time.Duration) error
- func (c *Client) ReleaseLock(m *concurrency.Mutex, s *concurrency.Session) error
- func (c *Client) Txn() error
- func (c *Client) WatchKey(key string)
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) ReleaseLock ¶
func (c *Client) ReleaseLock(m *concurrency.Mutex, s *concurrency.Session) error
ReleaseLock 释放锁
Click to show internal directories.
Click to hide internal directories.