leveldbstore

package module
v0.0.0-...-71f37ae Latest Latest
Warning

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

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

README

leveldbstore

GoDoc

Package leveldbstore implements the blob.Store interface using LevelDB.

Documentation

Overview

Package leveldbstore implements the blob.Store interface using LevelDB.

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 leveldbstore from an address comprising a path, for use with the store package.

Types

type Options

type Options struct {
	Create bool // create the database if it does not exist
}

Options provide optional settings for opening and creating a Store.

type Store

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

A Store implements the blob.Store interface backed by a LevelDB file.

func New

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

New opens a LevelDB database at path and returns a store associated with that database.

func (*Store) Close

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

Close closes the underlying LevelDB file.

func (*Store) Delete

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

Delete implements the corresponding method of the blob.Store interface.

func (*Store) Get

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

Get implements the corresponding method of the blob.Store interface.

func (*Store) Len

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

Len implements the corresponding method of the blob.Store interface.

func (*Store) List

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

List implements the corresponding method of the blob.Store interface.

func (*Store) Put

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

Put implements the corresponding method of the blob.Store interface.

Jump to

Keyboard shortcuts

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