Documentation
¶
Index ¶
- type Config
- type Opt
- type Store
- func (s *Store) Close() error
- func (s *Store) GetBytes(ctx context.Context, store string, key []byte) (result []byte, err error)
- func (s *Store) GetBytesAtVersion(ctx context.Context, store string, key []byte, version uint64) (result []byte, err error)
- func (s *Store) JumpToContext(context string) error
- func (s *Store) RunValueLogGC(discardRatio float64) error
- func (s *Store) SetBytes(ctx context.Context, store string, key []byte, value []byte) (err error)
- func (s *Store) SetBytesWithVersion(ctx context.Context, store string, key []byte, value []byte, version uint64) (err error)
- func (s *Store) Sync() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// Logger is where Badger system logs will go.
Logger badger.Logger
// DBPath the path to the database directory.
DBPath string
// Truncate whether to truncate the write log to remove corrupt data.
Truncate bool
// Allow git snapshots.
Snapshot bool
// Badger options to open DB
BadgerOptions badger.Options
// In Memory
InMemory bool
}
Config defines the configurable parameters of the Badger storage implementation.
type Opt ¶
type Opt func(*Config)
func WithLogger ¶
func WithPersist ¶ added in v0.38.0
func WithSnapshot ¶ added in v0.34.1
func WithTruncate ¶
type Store ¶
type Store struct {
storage.DefaultStore
// contains filtered or unexported fields
}
Store is an embedded storage implementation using Badger as the underlying persistent key-value store.
func (*Store) Close ¶
Close closes the underlying Badger database. It is necessary to close a Store before exiting to ensure all writes are persisted to disk.
func (*Store) GetBytesAtVersion ¶ added in v0.40.0
func (*Store) JumpToContext ¶ added in v0.27.0
func (*Store) RunValueLogGC ¶
func (*Store) SetBytesWithVersion ¶ added in v0.40.0
Click to show internal directories.
Click to hide internal directories.