badgerstore

package module
v0.1.18 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2023 License: Apache-2.0 Imports: 7 Imported by: 3

README

badgerstore

GoDoc

Package badgerstore implements the blob.Store interface using BadgerDB.

Documentation

Overview

Package badgerstore implements the blob.Store interface using Badger.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Opener

func Opener(_ context.Context, addr string) (blob.Store, error)

Opener constructs a filestore from an address comprising a URL, for use with the store package. The host and path of the URL give the path of the database directory. Optional query parameters include:

read_only   : open the database in read-only mode

Types

type Store

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

Store implements the blob.Store interface using a Badger key-value store.

func New

func New(opts badger.Options) (*Store, error)

New creates a Store by opening the Badger database specified by opts.

func NewPath

func NewPath(path string) (*Store, error)

NewPath creates a Store by opening a Badger database with default options at the specified path.

func NewPathReadOnly added in v0.0.3

func NewPathReadOnly(path string) (*Store, error)

NewPathReadOnly creates a Store around a read-only Badger instance with default options at the specified path.

func (*Store) Close

func (s *Store) Close() error

Close implements the io.Closer interface. It closes the underlying database instance and reports its result.

func (*Store) Delete

func (s *Store) Delete(_ context.Context, key string) error

Delete implements part of blob.Store.

func (*Store) Get

func (s *Store) Get(_ context.Context, key string) (data []byte, err error)

Get implements part of blob.Store.

func (*Store) Len

func (s *Store) Len(ctx context.Context) (int64, error)

Len implements part of blob.Store.

func (*Store) List

func (s *Store) List(ctx context.Context, start string, f func(string) error) error

List implements part of blob.Store.

func (*Store) Put

func (s *Store) Put(_ context.Context, opts blob.PutOptions) error

Put implements part of blob.Store.

func (*Store) Size

func (s *Store) Size(_ context.Context, key string) (size int64, err error)

Size implements part of blob.Store.

Jump to

Keyboard shortcuts

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