Version: v0.7.7 Latest Latest

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

Go to latest
Published: Oct 15, 2019 License: Apache-2.0 Imports: 14 Imported by: 67




View Source
const DefaultDBName = "cayley"


This section is empty.


func Init

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

func Register

func Register(name string, r Registration)


type InitFunc

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

type Iterator

type Iterator struct {
	// contains filtered or unexported fields

func NewIterator

func NewIterator(qs *QuadStore, collection string, constraints ...nosql.FieldFilter) *Iterator

func NewLinksToIterator

func NewLinksToIterator(qs *QuadStore, collection string, links []Linkage) *Iterator

func (*Iterator) AsShape added in v0.7.6

func (it *Iterator) AsShape() graph.IteratorShape

func (*Iterator) Sorted

func (it *Iterator) Sorted() bool

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 (h 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 added in v0.7.1

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

func (*QuadStore) NewQuadWriter added in v0.7.6

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

func (*QuadStore) NodesAllIterator

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

func (*QuadStore) OptimizeShape

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

func (*QuadStore) Quad

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

func (*QuadStore) QuadDirection

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

func (*QuadStore) QuadIterator

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

func (*QuadStore) QuadIteratorSize added in v0.7.6

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

func (*QuadStore) QuadsAllIterator

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

func (*QuadStore) Size

func (qs *QuadStore) Size() int64

func (*QuadStore) Stats added in v0.7.6

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

func (*QuadStore) ValueOf

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

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) graph.Iterator

func (Quads) Optimize

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

type Registration

type Registration struct {
	NewFunc      NewFunc
	InitFunc     InitFunc
	IsPersistent bool

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) graph.Iterator

func (Shape) Optimize

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

type Traits added in v0.7.6

type Traits = nosql.Traits


Path Synopsis

Jump to

Keyboard shortcuts

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