engine

package
v0.0.0-...-70285c8 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2016 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Drivers

func Drivers() []string

Returns current registered drivers

func Register

func Register(name string, driver Driver)

Registers a database driver by the specified driver name.

Types

type Batch

type Batch struct {
	OpList list.List
}

func NewBatch

func NewBatch() *Batch

func (*Batch) Del

func (bt *Batch) Del(key []byte)

func (*Batch) Len

func (bt *Batch) Len() int

func (*Batch) Reset

func (bt *Batch) Reset()

func (*Batch) Set

func (bt *Batch) Set(key, value []byte)

type BatchOpDel

type BatchOpDel struct {
	Key []byte
}

type BatchOpSet

type BatchOpSet struct {
	Key, Value []byte
}

type Database

type Database interface {
	Close()
	Clear() error
	NewIterator() Iterator
	NewSnapshot() Snapshot
	Commit(bt *Batch) error
	Compact(start, limit []byte) error
	Get(key []byte) ([]byte, error)
	Stats() string
}

func Open

func Open(name string, path string, conf interface{}, repair bool) (Database, error)

Opens a database specified by its database driver name.

type Driver

type Driver interface {
	Open(path string, conf interface{}, repair bool) (Database, error)
}

type Iterator

type Iterator interface {
	Close()
	SeekTo(key []byte) []byte
	SeekToFirst()
	SeekToLast()
	Valid() bool
	Next()
	Prev()
	Key() []byte
	Value() []byte
	Error() error
}

type Snapshot

type Snapshot interface {
	Close()
	NewIterator() Iterator
	Get(key []byte) ([]byte, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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