Documentation
¶
Index ¶
- type DB
- func (m *DB) DeleteExpiredKeys() error
- func (m *DB) Get(key string) (*api.Value, error)
- func (m *DB) GetMultiple(keys ...string) ([]*api.Value, error)
- func (m *DB) Put(keyVals ...*api.KeyValue) error
- func (m *DB) Query(query string) ([]*api.KeyValue, error)
- func (m *DB) WithError(err error) *DB
- func (m *DB) WithQueryResults(query string, results []*api.KeyValue) *DB
- func (m *DB) WithValue(key string, value *api.Value) *DB
- type DBProvider
- func (m *DBProvider) Close()
- func (m *DBProvider) GetDB(channelID string, coll string, ns string) (api.DB, error)
- func (m *DBProvider) MockDB(ns, coll string) *DB
- func (m *DBProvider) WithError(err error) *DBProvider
- func (m *DBProvider) WithQueryResults(ns, coll, query string, results []*api.KeyValue) *DBProvider
- func (m *DBProvider) WithValue(ns, coll, key string, value *api.Value) *DBProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB implements a mock DB
func (*DB) DeleteExpiredKeys ¶
DeleteExpiredKeys currently does nothing
func (*DB) GetMultiple ¶
GetMultiple retrieves multiple keys at once
func (*DB) WithQueryResults ¶
WithQueryResults sets the mock query results for the given query string
type DBProvider ¶
type DBProvider struct {
// contains filtered or unexported fields
}
DBProvider is a mock DB provider
func (*DBProvider) MockDB ¶
func (m *DBProvider) MockDB(ns, coll string) *DB
MockDB is a mock database
func (*DBProvider) WithError ¶
func (m *DBProvider) WithError(err error) *DBProvider
WithError simulates an error on the provider
func (*DBProvider) WithQueryResults ¶
func (m *DBProvider) WithQueryResults(ns, coll, query string, results []*api.KeyValue) *DBProvider
WithQueryResults sets the mock query results for the given query string
func (*DBProvider) WithValue ¶
func (m *DBProvider) WithValue(ns, coll, key string, value *api.Value) *DBProvider
WithValue sets a value for the given key
Click to show internal directories.
Click to hide internal directories.