leveldb

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2020 License: MIT Imports: 8 Imported by: 0

README

goleveldb Provider

a goleveldb based provider

Options

  • path: the db path, required.
  • sync_writes: whether to sync writes or not.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

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

Provider represents a driver

func (Provider) Batch

func (p Provider) Batch(entries []*goukv.Entry) error

Batch perform multi put operation, empty value means *delete*

func (Provider) Close

func (p Provider) Close() error

Close implements goukv.Close

func (Provider) Delete

func (p Provider) Delete(k []byte) error

Delete implements goukv.Delete

func (Provider) Get

func (p Provider) Get(k []byte) ([]byte, error)

Get implements goukv.Get

func (Provider) Open

func (p Provider) Open(dsn *goukv.DSN) (goukv.Provider, error)

Open implements goukv.Open

func (Provider) Put

func (p Provider) Put(e *goukv.Entry) error

Put implements goukv.Put

func (Provider) Scan

func (p Provider) Scan(opts goukv.ScanOpts) error

Scan implements goukv.Scan

func (Provider) TTL added in v1.3.0

func (p Provider) TTL(k []byte) (*time.Time, error)

TTL implements goukv.TTL

type Value

type Value struct {
	Value   []byte
	Expires *time.Time
}

Value represents a value with expiration date

func BytesToValue

func BytesToValue(b []byte) (v Value)

BytesToValue Decodes the specified byte array to Value

func EntryToValue

func EntryToValue(e *goukv.Entry) Value

EntryToValue build a value from entry representation

func (Value) Bytes

func (e Value) Bytes() []byte

Bytes encodes the value to a byte array

func (Value) IsExpired

func (e Value) IsExpired() bool

IsExpired whether the value is expired or not

Jump to

Keyboard shortcuts

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