kv

package
v0.0.0-...-05f225d Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoBucket = errors.New("kv: bucket is missing")
)

Functions

func Init

func Init(kv KV, _ graph.Options) error

func New

func New(kv KV, _ graph.Options) (graph.QuadStore, error)

func Type

func Type() graph.Type

func Update

func Update(kv KV, update func(tx Tx) error) error

func View

func View(kv KV, view func(tx Tx) error) error

Types

type AllIterator

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

func NewAllIterator

func NewAllIterator(nodes bool, qs *QuadStore, cons *constraint) *AllIterator

func (*AllIterator) Clone

func (it *AllIterator) Clone() graph.Iterator

func (*AllIterator) Close

func (it *AllIterator) Close() error

func (*AllIterator) Contains

func (it *AllIterator) Contains(v graph.Value) bool

func (*AllIterator) Describe

func (it *AllIterator) Describe() graph.Description

func (*AllIterator) Err

func (it *AllIterator) Err() error

func (*AllIterator) Next

func (it *AllIterator) Next() bool

func (*AllIterator) NextPath

func (it *AllIterator) NextPath() bool

func (*AllIterator) Optimize

func (it *AllIterator) Optimize() (graph.Iterator, bool)

func (*AllIterator) Reset

func (it *AllIterator) Reset()

func (*AllIterator) Result

func (it *AllIterator) Result() graph.Value

func (*AllIterator) Size

func (it *AllIterator) Size() (int64, bool)

func (*AllIterator) Sorted

func (it *AllIterator) Sorted() bool

func (*AllIterator) Stats

func (it *AllIterator) Stats() graph.IteratorStats

func (*AllIterator) SubIterators

func (it *AllIterator) SubIterators() []graph.Iterator

No subiterators.

func (*AllIterator) TagResults

func (it *AllIterator) TagResults(dst map[string]graph.Value)

func (*AllIterator) Tagger

func (it *AllIterator) Tagger() *graph.Tagger

func (*AllIterator) Type

func (it *AllIterator) Type() graph.Type

func (*AllIterator) UID

func (it *AllIterator) UID() uint64

type Bucket

type Bucket interface {
	Get(k []byte) []byte
	Put(k, v []byte) error
	ForEach(fn func(k, v []byte) error) error
}

type FillBucket

type FillBucket interface {
	SetFillPercent(v float64)
}

type Int64Set

type Int64Set []uint64

func (Int64Set) Len

func (a Int64Set) Len() int

func (Int64Set) Less

func (a Int64Set) Less(i, j int) bool

func (Int64Set) Swap

func (a Int64Set) Swap(i, j int)

type Int64Value

type Int64Value uint64

func (Int64Value) Key

func (v Int64Value) Key() interface{}

type KV

type KV interface {
	Type() string
	View() (Tx, error)
	Update() (Tx, error)
	Close() error
}

type QuadIterator

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

func NewQuadIterator

func NewQuadIterator(dir quad.Direction, v Int64Value, qs *QuadStore) *QuadIterator

func (*QuadIterator) Clone

func (it *QuadIterator) Clone() graph.Iterator

func (*QuadIterator) Close

func (it *QuadIterator) Close() error

func (*QuadIterator) Contains

func (it *QuadIterator) Contains(v graph.Value) bool

func (*QuadIterator) Describe

func (it *QuadIterator) Describe() graph.Description

func (*QuadIterator) Err

func (it *QuadIterator) Err() error

func (*QuadIterator) Next

func (it *QuadIterator) Next() bool

func (*QuadIterator) NextPath

func (it *QuadIterator) NextPath() bool

func (*QuadIterator) Optimize

func (it *QuadIterator) Optimize() (graph.Iterator, bool)

func (*QuadIterator) Reset

func (it *QuadIterator) Reset()

func (*QuadIterator) Result

func (it *QuadIterator) Result() graph.Value

func (*QuadIterator) Size

func (it *QuadIterator) Size() (int64, bool)

func (*QuadIterator) Sorted

func (it *QuadIterator) Sorted() bool

func (*QuadIterator) Stats

func (it *QuadIterator) Stats() graph.IteratorStats

func (*QuadIterator) SubIterators

func (it *QuadIterator) SubIterators() []graph.Iterator

func (*QuadIterator) TagResults

func (it *QuadIterator) TagResults(dst map[string]graph.Value)

func (*QuadIterator) Tagger

func (it *QuadIterator) Tagger() *graph.Tagger

func (*QuadIterator) Type

func (it *QuadIterator) Type() graph.Type

func (*QuadIterator) UID

func (it *QuadIterator) UID() uint64

type QuadStore

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

func (*QuadStore) ApplyDeltas

func (qs *QuadStore) ApplyDeltas(deltas []graph.Delta, ignoreOpts graph.IgnoreOpts) error

func (*QuadStore) Close

func (qs *QuadStore) Close() error

func (*QuadStore) FixedIterator

func (qs *QuadStore) FixedIterator() graph.FixedIterator

func (*QuadStore) Horizon

func (qs *QuadStore) Horizon() graph.PrimaryKey

func (*QuadStore) NameOf

func (qs *QuadStore) NameOf(k graph.Value) quad.Value

func (*QuadStore) NodesAllIterator

func (qs *QuadStore) NodesAllIterator() graph.Iterator

func (*QuadStore) OptimizeIterator

func (qs *QuadStore) OptimizeIterator(it graph.Iterator) (graph.Iterator, bool)

func (*QuadStore) Quad

func (qs *QuadStore) Quad(k graph.Value) quad.Quad

func (*QuadStore) QuadDirection

func (qs *QuadStore) QuadDirection(val graph.Value, d quad.Direction) graph.Value

func (*QuadStore) QuadIterator

func (qs *QuadStore) QuadIterator(dir quad.Direction, v graph.Value) graph.Iterator

func (*QuadStore) QuadsAllIterator

func (qs *QuadStore) QuadsAllIterator() graph.Iterator

func (*QuadStore) Size

func (qs *QuadStore) Size() int64

func (*QuadStore) Type

func (qs *QuadStore) Type() string

func (*QuadStore) ValueOf

func (qs *QuadStore) ValueOf(s quad.Value) graph.Value

type Tx

type Tx interface {
	Bucket(name []byte) Bucket
	CreateBucket(name []byte) (Bucket, error)
	Commit() error
	Rollback() error
}

Jump to

Keyboard shortcuts

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