Documentation ¶
Index ¶
- Variables
- func RegisterDriver(name string, fn driverSetupFn)
- type Attrs
- type FilterFn
- type Graph
- type IAtomicInstructions
- type ICollection
- type INode
- type INodeSet
- type IQueryBuilder
- type IStorage
- type LabelGroup
- func (lg *LabelGroup) Add(attrs Attrs) (NodeID, error)
- func (lg *LabelGroup) EnsureIndexLinks(attr_name string) error
- func (lg *LabelGroup) EnsureIndexNodes(attr_name string) error
- func (lg *LabelGroup) Merge(attrs Attrs) (NodeID, error)
- func (lg *LabelGroup) MustAdd(attrs Attrs) NodeID
- func (lg *LabelGroup) Query() *Query
- type Link
- type Node
- type NodeID
- type Query
- type Storage
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrDriverNotFound = errors.New("Driver not found")
)
Functions ¶
func RegisterDriver ¶
func RegisterDriver(name string, fn driverSetupFn)
Types ¶
type Graph ¶
type Graph struct {
// contains filtered or unexported fields
}
func (*Graph) Labels ¶
func (g *Graph) Labels(labels ...string) *LabelGroup
type IAtomicInstructions ¶
type IAtomicInstructions interface { // Adds exactly one new node to the database (with a new unique ID) Add(label string, attrs Attrs) (INode, error) // Removes one node Remove(id NodeID) error // Query Get(label string) (IQueryBuilder, error) Build() IQueryBuilder // Links Link(from, to INode, attrs Attrs) error }
type ICollection ¶
type INode ¶
type INode interface { ID() NodeID // Attributes Set(key string, value interface{}) error Has(key string) (bool, error) Get(key string) (interface{}, error) // In/out nodes In() INodeSet Out() INodeSet Both() INodeSet // The following methods are for convenient use; they panic on error. SafeSet(key string, value interface{}) SafeHas(key string) bool SafeGet(key string) interface{} }
type IQueryBuilder ¶
type IQueryBuilder interface { // Node properties HasLabel(label string) IQueryBuilder // filters all vertices for HasAttrKey(key string) IQueryBuilder // TODO: Uses Filter(), for convenient use HasAttrValue(key string, value interface{}) IQueryBuilder // TODO: Uses Filter(), for convenient use // HasValueGt[e](), HasValueLt[e](), HasValueBetween(), ... <-- for int* and time., for convenient use, using Filter() Filter(filterFn FilterFn) IQueryBuilder // filters all nodes at that stage Attr(key, value string) IQueryBuilder // Vertices In(edgeAttrs ...Attrs) IQueryBuilder Out(edgeAttrs ...Attrs) IQueryBuilder Both(edgeAttrs ...Attrs) IQueryBuilder // Set operations Intersect(b IQueryBuilder) IQueryBuilder Union(b IQueryBuilder) IQueryBuilder // Morphisms Follow(m IQueryBuilder) IQueryBuilder // Executors Count() int All() INodeSet Limit(n int) INodeSet Iterate() chan<- INode }
type IStorage ¶
type IStorage interface { ICollection Close() error }
type LabelGroup ¶
type LabelGroup struct {
// contains filtered or unexported fields
}
func (*LabelGroup) EnsureIndexLinks ¶
func (lg *LabelGroup) EnsureIndexLinks(attr_name string) error
func (*LabelGroup) EnsureIndexNodes ¶
func (lg *LabelGroup) EnsureIndexNodes(attr_name string) error
func (*LabelGroup) MustAdd ¶
func (lg *LabelGroup) MustAdd(attrs Attrs) NodeID
func (*LabelGroup) Query ¶
func (lg *LabelGroup) Query() *Query
type Storage ¶
type Storage interface { // Initializes the underlying storage, creates appropriate indexes and // establishes a connection, if not done yet Start(attrs string, dbname string) error // Stops the storage and shuts it down properly Stop() error EnsureIndexNodes(labels []string, attrName string) error EnsureIndexLinks(labels []string, attrName string) error // Elementary CRUD operations for nodes Add(labels []string, attrs Attrs) (NodeID, error) Merge(labels []string, attrs Attrs) (NodeID, error) Link(from, to NodeID, attrs Attrs) error Unlink(from, to NodeID, attrs Attrs) error Remove(id NodeID) error // Edge handling In(id NodeID) ([]*Link, error) Out(id NodeID) ([]*Link, error) // Attribute handling Set(id NodeID, key string, value interface{}) error Get(id NodeID, key string) (interface{}, error) Has(id NodeID, key string) (bool, error) Attrs(id NodeID) (Attrs, error) }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.