Documentation ¶
Index ¶
- type Database
- type Etcd
- func (e *Etcd) Close()
- func (e *Etcd) Connect() error
- func (e *Etcd) CreateLease(seconds int64) (clientv3.LeaseID, error)
- func (e *Etcd) Delete(key string) (int64, error)
- func (e *Etcd) Exists(key string) (bool, error)
- func (e *Etcd) Get(key string) (map[string]string, error)
- func (e *Etcd) GetKeys(key string) ([]string, error)
- func (e *Etcd) IsConnected() bool
- func (e *Etcd) Put(key, value string) error
- func (e *Etcd) PutWithLease(key, value string, leaseID clientv3.LeaseID) error
- func (e *Etcd) RenewLease(leaseID clientv3.LeaseID) error
- type EtcdMock
- func (e *EtcdMock) Close()
- func (e *EtcdMock) Connect() error
- func (e *EtcdMock) CreateLease(seconds int64) (clientv3.LeaseID, error)
- func (e *EtcdMock) Delete(key string) (int64, error)
- func (e *EtcdMock) Exists(key string) (bool, error)
- func (e *EtcdMock) Get(key string) (map[string]string, error)
- func (e *EtcdMock) GetKeys(key string) ([]string, error)
- func (e *EtcdMock) IsConnected() bool
- func (e *EtcdMock) Put(key, value string) error
- func (e *EtcdMock) PutWithLease(key, value string, leaseID clientv3.LeaseID) error
- func (e *EtcdMock) RenewLease(leaseID clientv3.LeaseID) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Database ¶
type Database interface { Connect() error IsConnected() bool Put(key, value string) error PutWithLease(key, value string, leaseID clientv3.LeaseID) error Get(key string) (map[string]string, error) Delete(key string) (int64, error) CreateLease(seconds int64) (clientv3.LeaseID, error) RenewLease(leaseID clientv3.LeaseID) error GetKeys(key string) ([]string, error) Exists(key string) (bool, error) Close() }
Database interface
type Etcd ¶
type Etcd struct {
// contains filtered or unexported fields
}
Etcd driver
func (*Etcd) CreateLease ¶
CreateLease creates a lease
func (*Etcd) GetKeys ¶
GetKeys gets a record sub keys This method will return only the keys under one key
func (*Etcd) IsConnected ¶
IsConnected checks if there is an etcd connection
func (*Etcd) PutWithLease ¶
PutWithLease sets a record
func (*Etcd) RenewLease ¶
RenewLease renews a lease
type EtcdMock ¶
EtcdMock type
func (*EtcdMock) CreateLease ¶
CreateLease mock
func (*EtcdMock) PutWithLease ¶
PutWithLease mock
func (*EtcdMock) RenewLease ¶
RenewLease mock
Click to show internal directories.
Click to hide internal directories.