Documentation ¶
Index ¶
- Constants
- type BadgerDB
- func (bdb *BadgerDB) Close() error
- func (bdb *BadgerDB) Delete(ctx context.Context, key []byte) error
- func (bdb *BadgerDB) Get(ctx context.Context, key []byte) (res []byte, err error)
- func (bdb *BadgerDB) NewTransaction(ctx context.Context, readOnly bool) (OrderedTransaction, error)
- func (bdb *BadgerDB) Put(ctx context.Context, key, value []byte) error
- type Basic
- type BasicTransaction
- type BasicTransactional
- type DatastoreDB
- func (dsDb *DatastoreDB) Close() error
- func (dsDb *DatastoreDB) Delete(ctx context.Context, key []byte) error
- func (dsDb *DatastoreDB) Get(ctx context.Context, key []byte) (res []byte, err error)
- func (dsDb *DatastoreDB) NewTransaction(ctx context.Context, readOnly bool) (OrderedTransaction, error)
- func (dsDb *DatastoreDB) Put(ctx context.Context, key, value []byte) error
- type GormDB
- func (gdb *GormDB) Close() error
- func (gdb *GormDB) Delete(ctx context.Context, key []byte) error
- func (gdb *GormDB) Get(ctx context.Context, key []byte) ([]byte, error)
- func (gdb *GormDB) NewTransaction(ctx context.Context, readOnly bool) (OrderedTransaction, error)
- func (gdb *GormDB) Put(ctx context.Context, key, value []byte) error
- type GromKeyValue
- type Iterator
- type KvError
- type Ordered
- type OrderedTransaction
- type OrderedTransactional
Constants ¶
const DataStoreKind = "keyvalue"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BadgerDB ¶
type BadgerDB struct { *badger.DB // contains filtered or unexported fields }
func NewbadgerFromDB ¶
func (*BadgerDB) NewTransaction ¶
NewTransaction for batching multiple values inside a transaction
type Basic ¶
type Basic interface { Get(ctx context.Context, Key []byte) ([]byte, error) Put(ctx context.Context, key, value []byte) error Delete(ctx context.Context, key []byte) error }
Basic is the simplest version of a key/value store
type BasicTransaction ¶
type BasicTransaction interface { Basic Discard(ctx context.Context) error Commit(ctx context.Context) error }
BasicTransactional bundles all basic operations into an atomic operation. it is safe to call Discard or Commit multiples times; only the first call should be respected. BasicTransactional implementations is expected to be returned by a NewTransaction(readOnly bool) method of a KeyValue store
type BasicTransactional ¶
type DatastoreDB ¶
func NewDatastoreDbFromUrl ¶
func NewDatastoreDbFromUrl(u *url.URL) (*DatastoreDB, error)
func (*DatastoreDB) Close ¶
func (dsDb *DatastoreDB) Close() error
Get gets the value of a key within a single query transaction
func (*DatastoreDB) Delete ¶
func (dsDb *DatastoreDB) Delete(ctx context.Context, key []byte) error
Delete removes a key within a single transaction
func (*DatastoreDB) NewTransaction ¶
func (dsDb *DatastoreDB) NewTransaction(ctx context.Context, readOnly bool) (OrderedTransaction, error)
NewTransaction for batching multiple values inside a transaction
type GormDB ¶
func (*GormDB) NewTransaction ¶
NewTransaction for batching multiple values inside a transaction
type GromKeyValue ¶
type Iterator ¶
Iterator scans a key space in a memory bound fashion. follow google design guidelines https://github.com/googleapis/google-cloud-go/wiki/Iterator-Guidelines
type Ordered ¶
Ordered is an extention to the basic store by also providing scan methods. all scans must be byte-wise lexicographical sorting order.
type OrderedTransaction ¶
type OrderedTransaction interface { Ordered Discard(ctx context.Context) error Commit(ctx context.Context) error }
OrderedTransaction is an extention to the basic store by also providing scan methods. all scans must be byte-wise lexicographical sorting order. OrderedTransactional implementations is expected to be returned by a NewTransaction(readOnly bool) method of a KeyValue store
type OrderedTransactional ¶
type OrderedTransactional interface { Basic NewTransaction(ctx context.Context, ReadOnly bool) (OrderedTransaction, error) }
func New ¶
func New(connectionString string) (OrderedTransactional, error)
New opens up a new db based on a connection string.