Documentation ¶
Index ¶
- Constants
- type Client
- func (cli *Client) Close() error
- func (cli *Client) Delete(ctx context.Context, key string) error
- func (cli *Client) Get(ctx context.Context, key string, isPrefix bool) ([]keyValue, error)
- func (cli *Client) GetOne(ctx context.Context, key string) (string, error)
- func (cli *Client) KeepAlive(ctx context.Context, key, value string, ttl int64) (int64, error)
- func (cli *Client) KeepAliveOnce(ctx context.Context, leaseId int64) error
- func (cli *Client) Put(ctx context.Context, key, value string) error
- func (cli *Client) PutWithNotExist(ctx context.Context, key, value string) error
- func (cli *Client) PutWithNotExistTTL(ctx context.Context, key, value string, ttl int64) (int64, error)
- func (cli *Client) PutWithTTL(ctx context.Context, key, value string, ttl int64) (int64, error)
- func (cli *Client) Revoke(ctx context.Context, leaseId int64) error
- func (cli *Client) SetLogPrint(lpf LogPrintFunc) *Client
- func (cli *Client) Watch(ctx context.Context, key string, isPrefix bool) (clientV3.Watcher, chan *WatchEvent)
- type ClientConfig
- type EventType
- type KeyChangeChan
- type LogPrintFunc
- type WatchEvent
Constants ¶
View Source
const ( EventCreate = EventType(1) // create event EventModify = EventType(2) // update event EventDelete = EventType(3) // delete event EventWatchCancel = EventType(4) // cancel event EventChannelSize = 32 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { sync.RWMutex LogPrint LogPrintFunc // contains filtered or unexported fields }
func NewEtcdClient ¶
func NewEtcdClient(config *ClientConfig) (*Client, error)
func (*Client) KeepAliveOnce ¶
func (*Client) PutWithNotExist ¶
func (*Client) PutWithNotExistTTL ¶
func (*Client) PutWithTTL ¶
func (*Client) SetLogPrint ¶
func (cli *Client) SetLogPrint(lpf LogPrintFunc) *Client
type ClientConfig ¶
type KeyChangeChan ¶
type KeyChangeChan <-chan *WatchEvent
type LogPrintFunc ¶
type LogPrintFunc func(v ...any)
type WatchEvent ¶
type WatchEvent struct { Event EventType Data keyValue }
Click to show internal directories.
Click to hide internal directories.