Documentation ¶
Index ¶
- Constants
- func GetCtxTimeout(second int) (context.Context, context.CancelFunc)
- type Client
- func (c *Client) DeleteKey(key string, opts ...v3.OpOption) (*v3.DeleteResponse, error)
- func (c *Client) GetKey(key string, opts ...v3.OpOption) (*v3.GetResponse, error)
- func (c *Client) GetRespFrom()
- func (c *Client) GetSessionKey(key string) *concurrency.Mutex
- func (c *Client) KeyClock(l *concurrency.Mutex, excute func()) chan *EctdResp
- func (c *Client) PutKey(key, val string, opts ...v3.OpOption) (*v3.PutResponse, error)
- func (c *Client) WatchKey(key string, ctx context.Context, opts ...v3.OpOption) chan *v3.Event
- type Connection
- type EctdResp
- type EtcdCfg
Constants ¶
View Source
const ( WatchLockOk = 1 WatchLockTimeout = 0 )
Variables ¶
This section is empty.
Functions ¶
func GetCtxTimeout ¶
func GetCtxTimeout(second int) (context.Context, context.CancelFunc)
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) GetRespFrom ¶
func (c *Client) GetRespFrom()
func (*Client) GetSessionKey ¶
func (c *Client) GetSessionKey(key string) *concurrency.Mutex
func (*Client) KeyClock ¶
func (c *Client) KeyClock(l *concurrency.Mutex, excute func()) chan *EctdResp
KeyClock waiting key free until ctx timeout, it will return err or key
type Connection ¶
type Connection interface { WatchKey(key string, ctx context.Context, opts ...v3.OpOption) chan *v3.Event PutKey(key, val string, opts ...v3.OpOption) (*v3.PutResponse, error) GetKey(key string, opts ...v3.OpOption) (*v3.GetResponse, error) DeleteKey(key string, opts ...v3.OpOption) (*v3.DeleteResponse, error) GetSessionKey(key string) *concurrency.Mutex KeyClock(l *concurrency.Mutex, excute func()) chan *EctdResp }
Click to show internal directories.
Click to hide internal directories.