graph

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMainReference added in v0.3.1

func GetMainReference(definition *base.RelationDefinition) string

GetMainReference -

Types

type Edge

type Edge struct {
	Extra any   `json:"extra"`
	From  *Node `json:"from"`
	To    *Node `json:"to"`
}

Edge - Edge Structure

type Graph

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

Graph - Graph Structure

func EntityToGraph

func EntityToGraph(entity *base.EntityDefinition) (g Graph, err error)

EntityToGraph - Convert entity to graph

func SchemaToGraph

func SchemaToGraph(schema *base.SchemaDefinition) (g Graph, err error)

SchemaToGraph - Convert schema to graph

func (*Graph) AddEdge

func (g *Graph) AddEdge(from, to *Node, extra any)

AddEdge - Add edge to graph

func (*Graph) AddEdges

func (g *Graph) AddEdges(e []*Edge)

AddEdges - Add edges to graph

func (*Graph) AddNode

func (g *Graph) AddNode(n *Node)

AddNode - Add node to graph

func (*Graph) AddNodes

func (g *Graph) AddNodes(n []*Node)

AddNodes - Add nodes to graph

func (*Graph) Edges

func (g *Graph) Edges() []*Edge

Edges - Return Edge Slice

func (*Graph) Nodes

func (g *Graph) Nodes() []*Node

Nodes - Return Nodes Slice

type Node

type Node struct {
	Type  string `json:"type"`
	ID    string `json:"id"`
	Label string `json:"label"`
}

Node - Structure

Jump to

Keyboard shortcuts

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