boltstore

package module
v0.0.0-...-1b1d0be Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: Apache-2.0 Imports: 5 Imported by: 1

README

boltstore

GoDoc

Package boltstore implements the blob.Store interface using bbolt.

Documentation

Overview

Package boltstore implements the blob.Store interface using bbolt.

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 Store from an address comprising a path, for use with the store package. If addr has the form name@path, the name is used as the bucket label.

Types

type Options

type Options struct {
	Mode        os.FileMode
	Bucket      string
	BoltOptions *bbolt.Options
}

Options provides options for opening a bbolt database.

type Store

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

Store implements the blob.Store interface using a bbolt database.

func Open

func Open(path string, opts *Options) (*Store, error)

Open creates a Store by opening the bbolt database specified by opts.

func (*Store) Close

func (s *Store) Close(_ context.Context) error

Close implements part of the blob.Store 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.

Jump to

Keyboard shortcuts

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