bitcaskstore

package module
v0.0.0-...-e944ab5 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2024 License: MIT Imports: 3 Imported by: 1

README

bitcaskstore

GoDoc

Package bitcaskstore implements the blob.Store interface using Bitcask.

Documentation

Overview

Package bitcaskstore implements the blob.Store interface on a bitcask database.

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 bitcaskstore from a path address.

Types

type Options

type Options struct{}

Options are configurations for a Store. A nil *Options is ready for use and provides default values as described.

type Store

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

Store implements the blob.Store interface on a bitcask database.

func New

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

New creates a Store for a bitcask database at the specified path. If opts == nil, default settings are used as described on Options.

func (*Store) Close

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

Close implements part of the blob.Store interface. It syncs and closes all of the data files in use by the database.

func (*Store) Delete

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

Delete implements part of blob.Store.

func (*Store) Get

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

func (*Store) Len

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

Len implements part of blob.Store. This implementation never returns an error.

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(ctx context.Context, opts blob.PutOptions) error

Put implements part of blob.Store. The bitcask implementation does not accept empty keys, so Put will report blob.ErrKeyNotFound for that case.

Jump to

Keyboard shortcuts

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