Documentation ¶
Index ¶
- Variables
- func Delete(key string) error
- func Get(key string) (*string, error)
- func Put(key string, value string) error
- type DBClient
- func (d *DBClient) AcquireLock(key string, ttl int) (lock.Lock, error)
- func (d *DBClient) CloseClient() error
- func (d *DBClient) Delete(key string) error
- func (d *DBClient) Get(key string) (*string, error)
- func (d *DBClient) IsLocked(key string) (bool, error)
- func (d *DBClient) Put(key string, value string) error
- func (d *DBClient) PutWithLeaseExpiry(key string, value string, seconds int64) error
- func (d *DBClient) ReleaseLock(lck lock.Lock) error
- func (d *DBClient) WaitAcquireLock(key string, ttl int) (lock.Lock, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // DefaultVersion of etcd DB DefaultVersion = "3" // DefaultHost IP address DefaultHost = "127.0.0.1" // DefaultPort number for client DefaultPort = "2379" // DefaultDialTimeout in seconds DefaultDialTimeout = 30 * time.Second // DefaultRequestTimeout in seconds DefaultRequestTimeout = 5 * time.Second )
Functions ¶
Types ¶
type DBClient ¶
DBClient is an implementor of the DBService interface
func NewClient ¶
NewClient creates new client instance for list of endpoints to access the DB server
func NewClientV3 ¶
NewClientV3 creates v3 client instance to access the DB server
func (*DBClient) AcquireLock ¶
AcquireLock for the given key
func (*DBClient) CloseClient ¶
CloseClient closes the DB client
func (*DBClient) PutWithLeaseExpiry ¶
PutWithLeaseExpiry value to DB
func (*DBClient) ReleaseLock ¶
ReleaseLock for the given key
Click to show internal directories.
Click to hide internal directories.