graph

package
v0.0.0-...-9206383 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2022 License: MIT Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Edge

type Edge struct {
	I, O string
	P    string
	X    interface{}
	T    int64
}

type GraphClient

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

func NewClient

func NewClient(f *firestore.Client, dbName string) *GraphClient

func (*GraphClient) GetClasses

func (client *GraphClient) GetClasses() ([]string, error)

func (*GraphClient) GetNode

func (client *GraphClient) GetNode(globalID string) (*Node, error)

func (*GraphClient) GetNodes

func (client *GraphClient) GetNodes(class string) ([]string, error)

func (*GraphClient) GetPredicates

func (client *GraphClient) GetPredicates(globalID string) ([]*PredicateStat, error)

func (*GraphClient) LinkNodes

func (client *GraphClient) LinkNodes(in, out string, predicate string, data ...map[string]interface{}) error

func (*GraphClient) NewNode

func (client *GraphClient) NewNode(node *Node) (*Node, error)

func (*GraphClient) SplitID

func (client *GraphClient) SplitID(id string) (string, string, error)

type Node

type Node struct {
	ID    string
	Class string
	// parent is the ID but a slice after split with "_"
	Parent []string            `firestore:"Parent,omitempty"`
	Data   interface{}         `firestore:"Data,omitempty"`
	Auto   map[string][]string `firestore:"Auto,omitempty"`
	Time   int64
	// contains filtered or unexported fields
}

func (*Node) Global

func (node *Node) Global() string

func (*Node) In

func (node *Node) In(predicate string) ([]string, error)

func (*Node) Out

func (node *Node) Out(predicate string) ([]string, error)

type PredicateStat

type PredicateStat struct {
	Key   string `firestore: "key,omitempty"`
	Value int    `firestore: "value"`
}

keeps track of total predicate content counts

Jump to

Keyboard shortcuts

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