persistence

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: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Internal_ID         = "_id"
	Internal_Type       = "_type"
	Internal_Direction  = "_direction"
	Internal_Relation   = "_relation"
	Internal_SourceType = "_source_type"
	Internal_SourceID   = "_source_id"
	Internal_TargetType = "_target_type"
	Internal_TargetID   = "_target_id"
)

Variables

This section is empty.

Functions

func New

func New(dir string) (api.Graph, error)

Types

type DB

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

func (*DB) AddNode

func (d *DB) AddNode(nodeType, nodeID string, properties map[string]interface{}) (api.Node, error)

func (*DB) Close

func (d *DB) Close() error

func (*DB) DelNode

func (d *DB) DelNode(nodeType, nodeID string) error

func (*DB) FSM

func (d *DB) FSM() raft.FSM

func (*DB) GetNode

func (d *DB) GetNode(nodeType, nodeID string) (api.Node, error)

func (*DB) GetRelation

func (d *DB) GetRelation(relation string, id string) (api.Relation, error)

func (*DB) NodeTypes

func (d *DB) NodeTypes() []string

func (*DB) RangeNodes

func (d *DB) RangeNodes(where *model.NodeWhere) (string, []api.Node, error)

func (*DB) RangeRelations

func (d *DB) RangeRelations(where *model.RelationWhere) (string, []api.Relation, error)

func (*DB) RelationTypes

func (d *DB) RelationTypes() []string

type Node

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

func (Node) AddRelation

func (n Node) AddRelation(direction api.Direction, relation string, properties map[string]interface{}, node api.Node) (api.Relation, error)

func (Node) DelProperty

func (n Node) DelProperty(name string) error

func (Node) DelRelation

func (n Node) DelRelation(relation string, id string) error

func (Node) GetProperty

func (n Node) GetProperty(name string) (interface{}, error)

func (Node) GetRelation

func (n Node) GetRelation(relation, id string) (api.Relation, bool, error)

func (Node) ID

func (n Node) ID() string

func (Node) Properties

func (n Node) Properties() (map[string]interface{}, error)

func (Node) Relations

func (n Node) Relations(where *model.RelationWhere) (string, []api.Relation, error)

func (Node) SetProperties

func (n Node) SetProperties(properties map[string]interface{}) error

func (Node) Type

func (n Node) Type() string

type Relation

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

func (*Relation) DelProperty

func (n *Relation) DelProperty(name string) error

func (Relation) Direction

func (r Relation) Direction() (api.Direction, error)

func (*Relation) GetProperty

func (n *Relation) GetProperty(name string) (interface{}, error)

func (*Relation) ID

func (n *Relation) ID() string

func (*Relation) Properties

func (n *Relation) Properties() (map[string]interface{}, error)

func (Relation) Relation

func (r Relation) Relation() (string, error)

func (*Relation) SetProperties

func (n *Relation) SetProperties(properties map[string]interface{}) error

func (Relation) Source

func (r Relation) Source() (api.Node, error)

func (Relation) Target

func (r Relation) Target() (api.Node, error)

func (*Relation) Type

func (n *Relation) Type() string

Jump to

Keyboard shortcuts

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