nosql

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: May 23, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultDBName = "cayley"

Variables

This section is empty.

Functions

func Init

func Init(db nosql.Database, opt graph.Options) error

func Register

func Register(name string, r Registration)

Types

type InitFunc

type InitFunc func(string, graph.Options) (nosql.Database, error)

type Iterator

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

func (*Iterator) Iterate

func (it *Iterator) Iterate() iterator.Scanner

func (*Iterator) Lookup

func (it *Iterator) Lookup() iterator.Index

func (*Iterator) Optimize

func (it *Iterator) Optimize(ctx context.Context) (iterator.Shape, bool)

func (*Iterator) Sorted

func (it *Iterator) Sorted() bool

func (*Iterator) Stats

func (it *Iterator) Stats(ctx context.Context) (iterator.Costs, error)

func (*Iterator) String

func (it *Iterator) String() string

func (*Iterator) SubIterators

func (it *Iterator) SubIterators() []iterator.Shape

type Linkage

type Linkage struct {
	Dir quad.Direction
	Val NodeHash
}

type NewFunc

type NewFunc func(string, graph.Options) (nosql.Database, error)

type NodeHash

type NodeHash string

func (NodeHash) IsNode

func (NodeHash) IsNode() bool

func (NodeHash) Key

func (v NodeHash) Key() interface{}

type QuadHash

type QuadHash [4]string

func (QuadHash) Get

func (v QuadHash) Get(d quad.Direction) string

func (QuadHash) IsNode

func (QuadHash) IsNode() bool

func (QuadHash) Key

func (v QuadHash) Key() interface{}

type QuadStore

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

func NewQuadStore

func NewQuadStore(db nosql.Database, nopt *Traits, opt graph.Options) (*QuadStore, error)

func (*QuadStore) ApplyDeltas

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

func (*QuadStore) Close

func (qs *QuadStore) Close() error

func (*QuadStore) NameOf

func (qs *QuadStore) NameOf(v graph.Ref) (quad.Value, error)

func (*QuadStore) NewQuadWriter

func (qs *QuadStore) NewQuadWriter() (quad.WriteCloser, error)

func (*QuadStore) NodesAllIterator

func (qs *QuadStore) NodesAllIterator() iterator.Shape

func (*QuadStore) OptimizeShape

func (qs *QuadStore) OptimizeShape(ctx context.Context, s shape.Shape) (shape.Shape, bool)

func (*QuadStore) Quad

func (qs *QuadStore) Quad(val graph.Ref) (quad.Quad, error)

func (*QuadStore) QuadDirection

func (qs *QuadStore) QuadDirection(in graph.Ref, d quad.Direction) (graph.Ref, error)

func (*QuadStore) QuadIterator

func (qs *QuadStore) QuadIterator(d quad.Direction, val graph.Ref) iterator.Shape

func (*QuadStore) QuadIteratorSize

func (qs *QuadStore) QuadIteratorSize(ctx context.Context, d quad.Direction, v graph.Ref) (refs.Size, error)

func (*QuadStore) QuadsAllIterator

func (qs *QuadStore) QuadsAllIterator() iterator.Shape

func (*QuadStore) Size

func (qs *QuadStore) Size() int64

func (*QuadStore) Stats

func (qs *QuadStore) Stats(ctx context.Context, exact bool) (graph.Stats, error)

func (*QuadStore) ValueOf

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

type Quads

type Quads struct {
	Links []Linkage // filters to select quads
	Limit int64     // limits a number of documents
}

Quads is a shape representing a quads query

func (Quads) BuildIterator

func (s Quads) BuildIterator(qs graph.QuadStore) iterator.Shape

func (Quads) Optimize

func (s Quads) Optimize(ctx context.Context, r shape.Optimizer) (shape.Shape, bool)

type Registration

type Registration struct {
	NewFunc      NewFunc
	InitFunc     InitFunc
	IsPersistent bool
	Traits
}

type Shape

type Shape struct {
	Collection string              // name of the collection
	Filters    []nosql.FieldFilter // filters to select documents
	Limit      int64               // limits a number of documents
}

Shape is a shape representing a documents query with filters

func (Shape) BuildIterator

func (s Shape) BuildIterator(qs graph.QuadStore) iterator.Shape

func (Shape) Optimize

func (s Shape) Optimize(ctx context.Context, r shape.Optimizer) (shape.Shape, bool)

type Traits

type Traits = nosql.Traits

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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