Documentation ¶
Overview ¶
Package db is the basic contract package for a database handled by goneo.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DatabaseService ¶
type Direction ¶
type Direction int
func DirectionFromString ¶
DirectionFromString converts a string to a direction
Example ¶
fmt.Println(DirectionFromString("out") == Outgoing)
Output: true
type Node ¶
type Node interface { Id() int String() string Property(prop string) interface{} Properties() map[string]string SetProperty(name, val string) HasProperty(prop string) bool HasLabel(labels ...string) bool Labels() []string RelateTo(end Node, relType string) Relation Relations(dir Direction) []Relation }
type Path ¶
type Path interface { Nodes() []Node Relations() []Relation Items() []PropertyContainer String() string }
Path encapsulates a simple path in a graph
type PathBuilder ¶
type PathBuilder struct {
// contains filtered or unexported fields
}
PathBuilder provides a way to build a path.
func NewPathBuilder ¶
func NewPathBuilder(start Node) *PathBuilder
Example ¶
var start Node = &mocknode{"a"} var end Node = &mocknode{"b"} var rel = start.RelateTo(end, "HAS") builder := NewPathBuilder(start) builder = builder.Append(rel) path := builder.Build() fmt.Println(path.String())
Output: (a)-[:HAS]->(b)
func (*PathBuilder) Append ¶
func (builder *PathBuilder) Append(rel Relation) *PathBuilder
func (*PathBuilder) Build ¶
func (builder *PathBuilder) Build() Path
func (*PathBuilder) Last ¶
func (builder *PathBuilder) Last() Node
type PropertyContainer ¶
PropertyContainer encapsulates graph nodes and edges so they can be handled interchangeably for output.
Directories ¶
Path | Synopsis |
---|---|
Package mem is a simple memory based implementation of DatabaseService.
|
Package mem is a simple memory based implementation of DatabaseService. |
Package simplefile for a simple file backed DatabaseService.
|
Package simplefile for a simple file backed DatabaseService. |
Click to show internal directories.
Click to hide internal directories.