goleveldb

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

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

Go to latest
Published: Dec 17, 2017 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(path string) (store kvs.Store, err error)

New creates or open a existing Store

Types

type Batch

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

func (*Batch) Delete

func (b *Batch) Delete(path ...string)

Delete the value for the given key

func (*Batch) Set

func (b *Batch) Set(value []byte, path ...string)

Set the value for the given key

func (*Batch) SetWithTTL

func (b *Batch) SetWithTTL(value []byte, ttl time.Duration, path ...string)

SetWithTTL the value for the given key with a time to live

func (*Batch) Write

func (b *Batch) Write() (err error)

Write batch

type Store

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

Store leveldb

func (*Store) Close

func (s *Store) Close() (err error)

Close the store

func (*Store) Delete

func (s *Store) Delete(path ...string) (err error)

Delete the value for the given key

func (*Store) DeleteTree

func (s *Store) DeleteTree(path ...string) (err error)

DeleteTree deletes the values for keys under the given prefix

func (*Store) Get

func (s *Store) Get(path ...string) (value []byte, err error)

Get the value for the given key

func (*Store) GetTree

func (s *Store) GetTree(path ...string) (entries []kvs.Entry, err error)

GetTree returns the values for keys under the given prefix

func (*Store) Has

func (s *Store) Has(path ...string) (exists bool, err error)

Has returns true if the store does contains the given key

func (*Store) NewBatch

func (s *Store) NewBatch() (batch kvs.Batch)

NewBatch creates a new Batch

func (*Store) Remove

func (s *Store) Remove() (err error)

Remove closes and remove the store

func (*Store) Set

func (s *Store) Set(value []byte, path ...string) (err error)

Set the value for the given key

func (*Store) SetWithTTL

func (s *Store) SetWithTTL(value []byte, ttl time.Duration, path ...string) (err error)

SetWithTTL the value for the given key with a time to live

Jump to

Keyboard shortcuts

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