leveldbstore

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package leveldbstore provides implementation of LevelDB key/value database.

Create or open a database:

// The returned DB instance is safe for concurrent use. Which mean that all
// DB's methods may be called concurrently from multiple goroutine.
db, err := leveldbstore.NewStore("path/to/db")
...
defer db.Close()
...

Read or modify the database content:

// Remember that the contents of the returned slice should not be modified.
data := db.Get(key)
...
db.Put(key), []byte("value"))
...
db.Delete(key)
...

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LevelDBStore

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

func NewStore

func NewStore(path string) (*LevelDBStore, error)

NewStore create a new Store implemented by LevelDB

func (*LevelDBStore) Close

func (s *LevelDBStore) Close() error

Close closes the service

func (*LevelDBStore) Delete

func (s *LevelDBStore) Delete(key string)

func (*LevelDBStore) Get

func (s *LevelDBStore) Get(key string) []byte

Get returns the value corresponding to the given key

func (*LevelDBStore) Set

func (s *LevelDBStore) Set(key string, value []byte)

Set stores the url for a given fingerprint

Jump to

Keyboard shortcuts

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