badger

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

Store is a BadgerDB-backed store.Storage.

func Open

func Open(dir string) (*Store, error)

Open opens (or creates) a BadgerDB at the given directory path and returns a Store wrapping it. Call Close() when done.

func OpenReadOnly

func OpenReadOnly(dir string) (*Store, error)

OpenReadOnly opens an existing BadgerDB at dir for read-only access. It does not acquire the directory lock, so multiple readers (and one concurrent writer) can coexist. Mutating methods on the returned Store will return an error from BadgerDB.

func (*Store) AppendReflog

func (s *Store) AppendReflog(_ context.Context, name string, e store.ReflogEntry) error

func (*Store) CASRef

func (s *Store) CASRef(_ context.Context, name string, expected, next store.Hash) error

func (*Store) Close

func (s *Store) Close() error

func (*Store) DeleteRef

func (s *Store) DeleteRef(_ context.Context, name string, expected store.Hash) error

func (*Store) GetObject

func (s *Store) GetObject(_ context.Context, h store.Hash) (store.Object, error)

func (*Store) GetRef

func (s *Store) GetRef(_ context.Context, name string) (store.Hash, bool, error)

func (*Store) HasObject

func (s *Store) HasObject(_ context.Context, h store.Hash) (bool, error)

func (*Store) IterObjects

func (s *Store) IterObjects(_ context.Context, fn func(store.Hash, store.Object) error) error

func (*Store) ListRefs

func (s *Store) ListRefs(_ context.Context, prefix string) ([]store.RefEntry, error)

func (*Store) PutObject

func (s *Store) PutObject(_ context.Context, h store.Hash, o store.Object) error

func (*Store) ReadReflog

func (s *Store) ReadReflog(_ context.Context, name string) ([]store.ReflogEntry, error)

Jump to

Keyboard shortcuts

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