Documentation ¶
Index ¶
- Variables
- func NewDB(url string) (database.Storage, error)
- type EtcDBatch
- type EtcDStorage
- func (s *EtcDStorage) Close() error
- func (s *EtcDStorage) CompactDB() error
- func (s *EtcDStorage) CreateBatch() database.Batch
- func (s *EtcDStorage) CreateTemporary() (database.Storage, error)
- func (s *EtcDStorage) Delete(key []byte) (err error)
- func (s *EtcDStorage) Drop() error
- func (s *EtcDStorage) FetchByPrefix(prefix []byte) [][]byte
- func (s *EtcDStorage) Get(key []byte) (value []byte, err error)
- func (s *EtcDStorage) HasPrefix(prefix []byte) bool
- func (s *EtcDStorage) KeysByPrefix(prefix []byte) [][]byte
- func (s *EtcDStorage) Open() error
- func (s *EtcDStorage) OpenTransaction() (database.Transaction, error)
- func (s *EtcDStorage) ProcessByPrefix(prefix []byte, proc database.StorageProcessor) error
- func (s *EtcDStorage) Put(key []byte, value []byte) (err error)
- type WriteOptions
Constants ¶
This section is empty.
Variables ¶
View Source
var Ctx = context.TODO()
Functions ¶
Types ¶
type EtcDStorage ¶
type EtcDStorage struct {
// contains filtered or unexported fields
}
func (*EtcDStorage) CompactDB ¶
func (s *EtcDStorage) CompactDB() error
CompactDB does nothing for etcd
func (*EtcDStorage) CreateBatch ¶
func (s *EtcDStorage) CreateBatch() database.Batch
CreateBatch creates a Batch object
func (*EtcDStorage) CreateTemporary ¶
func (s *EtcDStorage) CreateTemporary() (database.Storage, error)
CreateTemporary creates new DB of the same type in temp dir
func (*EtcDStorage) Delete ¶
func (s *EtcDStorage) Delete(key []byte) (err error)
Delete removes key from etcd
func (*EtcDStorage) Drop ¶
func (s *EtcDStorage) Drop() error
Drop removes only temporary DBs with etcd (i.e. remove all prefixed keys)
func (*EtcDStorage) FetchByPrefix ¶
func (s *EtcDStorage) FetchByPrefix(prefix []byte) [][]byte
FetchByPrefix returns all values with keys that start with prefix
func (*EtcDStorage) Get ¶
func (s *EtcDStorage) Get(key []byte) (value []byte, err error)
Get key value from etcd
func (*EtcDStorage) HasPrefix ¶
func (s *EtcDStorage) HasPrefix(prefix []byte) bool
HasPrefix checks whether it can find any key with given prefix and returns true if one exists
func (*EtcDStorage) KeysByPrefix ¶
func (s *EtcDStorage) KeysByPrefix(prefix []byte) [][]byte
KeysByPrefix returns all keys that start with prefix
func (*EtcDStorage) Open ¶
func (s *EtcDStorage) Open() error
Reopen tries to open (re-open) the database
func (*EtcDStorage) OpenTransaction ¶
func (s *EtcDStorage) OpenTransaction() (database.Transaction, error)
OpenTransaction creates new transaction.
func (*EtcDStorage) ProcessByPrefix ¶
func (s *EtcDStorage) ProcessByPrefix(prefix []byte, proc database.StorageProcessor) error
ProcessByPrefix iterates through all entries where key starts with prefix and calls StorageProcessor on key value pair
type WriteOptions ¶
Click to show internal directories.
Click to hide internal directories.