api

package
v0.0.0-...-c46e59b Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Direction

type Direction string
const (
	Outgoing Direction = "OUTGOING"
	Incoming Direction = "INCOMING"
)

func (Direction) Opposite

func (d Direction) Opposite() Direction

type Entity

type Entity interface {
	ID() string
	Type() string
	Properties() (map[string]interface{}, error)
	GetProperty(name string) (interface{}, error)
	SetProperties(properties map[string]interface{}) error
	DelProperty(name string) error
}

type Graph

type Graph interface {
	GetNode(typee string, id string) (Node, error)
	AddNode(typee string, id string, properties map[string]interface{}) (Node, error)
	DelNode(typee string, id string) error
	RangeNodes(where *model.NodeWhere) (string, []Node, error)
	NodeTypes() []string

	GetRelation(relation string, id string) (Relation, error)
	RangeRelations(where *model.RelationWhere) (string, []Relation, error)
	RelationTypes() []string

	Close() error
	FSM() raft.FSM
}

type Node

type Node interface {
	Entity
	AddRelation(direction Direction, relation string, properties map[string]interface{}, node Node) (Relation, error)
	DelRelation(relation string, id string) error
	GetRelation(relation, id string) (Relation, bool, error)
	Relations(where *model.RelationWhere) (string, []Relation, error)
}

type Relation

type Relation interface {
	Entity
	Source() (Node, error)
	Target() (Node, error)
}

Jump to

Keyboard shortcuts

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