store

package
v0.12.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 18, 2021 License: BSD-3-Clause Imports: 8 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrKeyNotFound         = badger.ErrKeyNotFound
	DefaultIteratorOptions = badger.DefaultIteratorOptions
)
View Source
var (
	ErrAlreadyExists = fmt.Errorf("already exists")
	ErrEmptyObject   = fmt.Errorf("empty object")
)

Functions

func Delete added in v0.5.25

func Delete(txn *rony.StoreTxn, alloc *tools.Allocator, keyParts ...interface{}) error

func Exists added in v0.5.25

func Exists(txn *rony.StoreTxn, alloc *tools.Allocator, keyParts ...interface{}) bool

func ExistsByKey added in v0.12.0

func ExistsByKey(txn *rony.StoreTxn, alloc *tools.Allocator, key []byte) bool

func Get added in v0.5.25

func Get(txn *rony.StoreTxn, alloc *tools.Allocator, keyParts ...interface{}) ([]byte, error)

func GetByKey added in v0.5.25

func GetByKey(txn *rony.StoreTxn, alloc *tools.Allocator, key []byte) ([]byte, error)

func Marshal added in v0.5.25

func Marshal(txn *rony.StoreTxn, alloc *tools.Allocator, m proto.Message, keyParts ...interface{}) error

func Move added in v0.5.25

func Move(txn *rony.StoreTxn, oldKey, newKey []byte) error

func Set added in v0.5.25

func Set(txn *rony.StoreTxn, alloc *tools.Allocator, val []byte, keyParts ...interface{}) error

func SetByKey added in v0.12.0

func SetByKey(txn *rony.StoreTxn, val, key []byte) error

func Unmarshal added in v0.5.25

func Unmarshal(txn *rony.StoreTxn, alloc *tools.Allocator, m proto.Message, keyParts ...interface{}) error

func UnmarshalMerge added in v0.5.25

func UnmarshalMerge(txn *rony.StoreTxn, alloc *tools.Allocator, m proto.Message, keyParts ...interface{}) error

Types

type Config

type Config struct {
	DirPath             string
	ConflictRetries     int
	ConflictMaxInterval time.Duration
	BatchWorkers        int
	BatchSize           int
	InMemory            bool
}

func DefaultConfig

func DefaultConfig(dataPath string) Config

type Entry added in v0.5.6

type Entry = badger.Entry

func NewEntry added in v0.5.15

func NewEntry(key, value []byte) *Entry

type Item added in v0.12.0

type Item = badger.Item

type IterOption

type IterOption struct {
	// contains filtered or unexported fields
}

func NewIterOption

func NewIterOption() *IterOption

func (*IterOption) Backward

func (o *IterOption) Backward() bool

func (*IterOption) OffsetKey

func (o *IterOption) OffsetKey() []byte

func (*IterOption) OnClose

func (o *IterOption) OnClose(key []byte)

func (*IterOption) SetBackward

func (o *IterOption) SetBackward() *IterOption

func (*IterOption) SetForward

func (o *IterOption) SetForward() *IterOption

func (*IterOption) SetOffsetKey

func (o *IterOption) SetOffsetKey(offset []byte) *IterOption

func (*IterOption) SetOnClose

func (o *IterOption) SetOnClose(f func(key []byte)) *IterOption

type ListOption

type ListOption struct {
	// contains filtered or unexported fields
}

func NewListOption

func NewListOption() *ListOption

func (*ListOption) Backward

func (o *ListOption) Backward() bool

func (*ListOption) Limit

func (o *ListOption) Limit() int32

func (*ListOption) SetBackward

func (o *ListOption) SetBackward() *ListOption

func (*ListOption) SetForward

func (o *ListOption) SetForward() *ListOption

func (*ListOption) SetLimit

func (o *ListOption) SetLimit(limit int32) *ListOption

func (*ListOption) SetSkip

func (o *ListOption) SetSkip(skip int32) *ListOption

func (*ListOption) Skip

func (o *ListOption) Skip() int32

type LocalDB added in v0.7.2

type LocalDB = badger.DB

type Store added in v0.5.6

type Store struct {
	// contains filtered or unexported fields
}

func New added in v0.12.3

func New(cfg Config) (*Store, error)

func (*Store) LocalDB added in v0.12.3

func (s *Store) LocalDB() *LocalDB

func (*Store) Shutdown added in v0.7.2

func (s *Store) Shutdown()

func (*Store) Update added in v0.7.2

func (s *Store) Update(fn func(txn *rony.StoreTxn) error) error

func (*Store) View added in v0.7.2

func (s *Store) View(fn func(txn *rony.StoreTxn) error) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL