Versions in this module Expand all Collapse all v1 v1.0.1 Apr 26, 2022 Changes in this version + const BadgerHoldIndexTag + const BadgerholdKeyTag + const Key + var DefaultOptions = Options + var ErrKeyExists = errors.New("This Key already exists in badgerhold for this type") + var ErrNotFound = errors.New("No data found for this key") + var ErrUniqueExists = errors.New("This value cannot be written due to the unique constraint on the field") + func DefaultDecode(data []byte, value interface{}) error + func DefaultEncode(value interface{}) ([]byte, error) + func NextSequence() interface + func Slice(value interface{}) []interface + type AggregateResult struct + func (a *AggregateResult) Avg(field string) float64 + func (a *AggregateResult) Count() uint64 + func (a *AggregateResult) Group(result ...interface{}) + func (a *AggregateResult) Max(field string, result interface{}) + func (a *AggregateResult) Min(field string, result interface{}) + func (a *AggregateResult) Reduction(result interface{}) + func (a *AggregateResult) Sort(field string) + func (a *AggregateResult) Sum(field string) float64 + type Comparer interface + Compare func(other interface{}) (int, error) + type Criterion struct + func Where(field string) *Criterion + func (c *Criterion) Contains(value interface{}) *Query + func (c *Criterion) ContainsAll(values ...interface{}) *Query + func (c *Criterion) ContainsAny(values ...interface{}) *Query + func (c *Criterion) Eq(value interface{}) *Query + func (c *Criterion) Ge(value interface{}) *Query + func (c *Criterion) Gt(value interface{}) *Query + func (c *Criterion) HasKey(value interface{}) *Query + func (c *Criterion) HasPrefix(prefix string) *Query + func (c *Criterion) HasSuffix(suffix string) *Query + func (c *Criterion) In(values ...interface{}) *Query + func (c *Criterion) IsNil() *Query + func (c *Criterion) Le(value interface{}) *Query + func (c *Criterion) Lt(value interface{}) *Query + func (c *Criterion) MatchFunc(match MatchFunc) *Query + func (c *Criterion) Ne(value interface{}) *Query + func (c *Criterion) RegExp(expression *regexp.Regexp) *Query + func (c *Criterion) String() string + type DecodeFunc func(data []byte, value interface{}) error + type EncodeFunc func(value interface{}) ([]byte, error) + type ErrTypeMismatch struct + Other interface{} + Value interface{} + func (e *ErrTypeMismatch) Error() string + type Field string + type Index struct + IndexFunc func(name string, value interface{}) ([]byte, error) + Unique bool + type KeyList [][]byte + type MatchFunc func(ra *RecordAccess) (bool, error) + type Options struct + Decoder DecodeFunc + Encoder EncodeFunc + SequenceBandwith uint64 + type Query struct + func (q *Query) And(field string) *Criterion + func (q *Query) Index(indexName string) *Query + func (q *Query) IsEmpty() bool + func (q *Query) Limit(amount int) *Query + func (q *Query) Or(query *Query) *Query + func (q *Query) Reverse() *Query + func (q *Query) Skip(amount int) *Query + func (q *Query) SortBy(fields ...string) *Query + func (q *Query) String() string + type RecordAccess struct + func (r *RecordAccess) Field() interface{} + func (r *RecordAccess) Record() interface{} + func (r *RecordAccess) SubAggregateQuery(query *Query, groupBy ...string) ([]*AggregateResult, error) + func (r *RecordAccess) SubQuery(result interface{}, query *Query) error + type Store struct + func Open(options Options) (*Store, error) + func (s *Store) Badger() *badger.DB + func (s *Store) Close() error + func (s *Store) Count(dataType interface{}, query *Query) (uint64, error) + func (s *Store) Delete(key, dataType interface{}) error + func (s *Store) DeleteMatching(dataType interface{}, query *Query) error + func (s *Store) Find(result interface{}, query *Query) error + func (s *Store) FindAggregate(dataType interface{}, query *Query, groupBy ...string) ([]*AggregateResult, error) + func (s *Store) FindOne(result interface{}, query *Query) error + func (s *Store) ForEach(query *Query, fn interface{}) error + func (s *Store) Get(key, result interface{}) error + func (s *Store) Insert(key, data interface{}) error + func (s *Store) InsertTTL(key, data interface{}, ttl time.Duration) error + func (s *Store) TxCount(tx *badger.Txn, dataType interface{}, query *Query) (uint64, error) + func (s *Store) TxDelete(tx *badger.Txn, key, dataType interface{}) error + func (s *Store) TxDeleteMatching(tx *badger.Txn, dataType interface{}, query *Query) error + func (s *Store) TxFind(tx *badger.Txn, result interface{}, query *Query) error + func (s *Store) TxFindAggregate(tx *badger.Txn, dataType interface{}, query *Query, groupBy ...string) ([]*AggregateResult, error) + func (s *Store) TxFindOne(tx *badger.Txn, result interface{}, query *Query) error + func (s *Store) TxForEach(tx *badger.Txn, query *Query, fn interface{}) error + func (s *Store) TxGet(tx *badger.Txn, key, result interface{}) error + func (s *Store) TxInsert(tx *badger.Txn, key, data interface{}) error + func (s *Store) TxInsertTTL(tx *badger.Txn, key, data interface{}, ttl time.Duration) error + func (s *Store) TxUpdate(tx *badger.Txn, key interface{}, data interface{}) error + func (s *Store) TxUpdateMatching(tx *badger.Txn, dataType interface{}, query *Query, ...) error + func (s *Store) TxUpdateTTL(tx *badger.Txn, key interface{}, data interface{}, ttl time.Duration) error + func (s *Store) TxUpsert(tx *badger.Txn, key interface{}, data interface{}) error + func (s *Store) TxUpsertTTL(tx *badger.Txn, key interface{}, data interface{}, ttl time.Duration) error + func (s *Store) Update(key interface{}, data interface{}) error + func (s *Store) UpdateMatching(dataType interface{}, query *Query, update func(record interface{}) error) error + func (s *Store) UpdateTTL(key interface{}, data interface{}, ttl time.Duration) error + func (s *Store) Upsert(key interface{}, data interface{}) error + func (s *Store) UpsertTTL(key interface{}, data interface{}, ttl time.Duration) error + type Storer interface + Indexes func() map[string]Index + Type func() string