graph

package
v0.8.7 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder added in v0.4.6

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

func NewBuilder added in v0.4.6

func NewBuilder(schema *base.SchemaDefinition) Builder

NewBuilder creates a new Builder object.

func (Builder) EntityToGraph added in v0.4.6

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

EntityToGraph takes an entity definition and converts it into a graph representation, returning the created graph and an error if any occurs.

func (Builder) RuleToGraph added in v0.5.1

func (b Builder) RuleToGraph(rule *base.RuleDefinition) (g Graph, err error)

RuleToGraph converts a RuleDefinition into a graph. It takes a RuleDefinition as input and constructs a graph representing the rule. The graph consists of a single node representing the rule itself.

func (Builder) SchemaToGraph added in v0.4.6

func (b Builder) SchemaToGraph() (g Graph, err error)

SchemaToGraph converts a schema definition into a graph representation.

type Edge

type Edge struct {
	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 (*Graph) AddEdge

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

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