diskv

package
v0.0.0-...-535183f Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Open

func Open(paths ...string) gkv.KV

Open creates a new diskv driver by storage file path. paths are storage file paths.

Types

type KV

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

KV is peterbourgon/diskv adapter.

func (*KV) Close

func (kv *KV) Close() error

Close releases all database resources.

func (*KV) Count

func (kv *KV) Count() (i int)

Count returns the total number of all the keys.

func (KV) DB

func (kv KV) DB() interface{}

DB returns the native DB of the adapter.

func (*KV) Delete

func (kv *KV) Delete(key []byte) error

Delete deletes the given key from the database resources.

func (*KV) Get

func (kv *KV) Get(key []byte) (value []byte)

Get retrieves the value for a key.

func (*KV) Iterator

func (kv *KV) Iterator(f func([]byte, []byte) bool) error

Iterator creates an iterator for iterating over all the keys.

func (*KV) Put

func (kv *KV) Put(key, value []byte) error

Put sets the value for a key.

func (*KV) Register

func (kv *KV) Register(table []byte) error

Register initializes a new database if it doesn't already exist.

Jump to

Keyboard shortcuts

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