Documentation ¶
Index ¶
- Constants
- Variables
- type BadgerTransaction
- type Decoder
- type Encoder
- type EncoderDecoder
- type KVStore
- type Logger
- type MsgPackEncoding
- type SetOption
- type SetOptionFunc
- type Store
- func (s *Store) Close() error
- func (s *Store) Get(key string, v interface{}) error
- func (s *Store) GetAll(prefix string, into interface{}) error
- func (s *Store) ReadOnlyTransaction(ops func(reader TxnReader) error) error
- func (s *Store) ReadWriteTransaction(ops func(rw TxnReaderWriter) error) error
- func (s *Store) Set(key string, v interface{}, opts ...SetOption) error
- func (s *Store) WithSuffixes(suffixes ...string) KVStore
- type StoreOption
- type StoreOptionFunc
- type StoreOptions
- type TestLogger
- type TxnReader
- type TxnReaderWriter
- type TxnWriter
- type WithTTL
Constants ¶
View Source
const DefaultPrefix = "/"
Variables ¶
View Source
var ( ErrReceiverNotAPointer = errors.New("receiver is not a pointer") ErrReceiverNotASlice = errors.New("receiver is not a slice") )
Functions ¶
This section is empty.
Types ¶
type BadgerTransaction ¶
type EncoderDecoder ¶
type Logger ¶
type Logger struct {
*zap.SugaredLogger
}
type MsgPackEncoding ¶
type MsgPackEncoding struct{}
func (MsgPackEncoding) Decode ¶
func (m MsgPackEncoding) Decode(data []byte, v interface{}) error
func (MsgPackEncoding) Encode ¶
func (m MsgPackEncoding) Encode(v interface{}) (data []byte, err error)
type SetOptionFunc ¶
type SetOptionFunc func(e *badger.Entry)
func (SetOptionFunc) Apply ¶
func (f SetOptionFunc) Apply(e *badger.Entry)
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func NewDefault ¶
func NewDefault(opts ...StoreOption) (*Store, error)
func (*Store) ReadOnlyTransaction ¶
func (*Store) ReadWriteTransaction ¶
func (s *Store) ReadWriteTransaction(ops func(rw TxnReaderWriter) error) error
func (*Store) WithSuffixes ¶
type StoreOption ¶
type StoreOption interface {
Apply(opt *StoreOptions)
}
func WithEncoding ¶
func WithEncoding(encoding EncoderDecoder) StoreOption
func WithInMemory ¶
func WithInMemory() StoreOption
func WithLogger ¶
func WithLogger(logger badger.Logger) StoreOption
func WithPath ¶
func WithPath(filePath string) StoreOption
type StoreOptionFunc ¶
type StoreOptionFunc func(opt *StoreOptions)
func (StoreOptionFunc) Apply ¶
func (f StoreOptionFunc) Apply(opt *StoreOptions)
type StoreOptions ¶
type StoreOptions struct { FilePath string InMemory bool Encoding EncoderDecoder Logger badger.Logger }
type TestLogger ¶
func (TestLogger) Debugf ¶
func (l TestLogger) Debugf(s string, i ...interface{})
func (TestLogger) Errorf ¶
func (l TestLogger) Errorf(s string, i ...interface{})
func (TestLogger) Infof ¶
func (l TestLogger) Infof(s string, i ...interface{})
func (TestLogger) Warningf ¶
func (l TestLogger) Warningf(s string, i ...interface{})
type TxnReaderWriter ¶
Click to show internal directories.
Click to hide internal directories.