graph

package
v0.13.6 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Graph

type Graph[T any] struct {
	// contains filtered or unexported fields
}

func NewGraph

func NewGraph[T any]() *Graph[T]

func (*Graph[T]) AddChild

func (g *Graph[T]) AddChild(parent string, children ...string) error

func (*Graph[T]) AddNode

func (g *Graph[T]) AddNode(node *Node[T])

func (*Graph[T]) Children

func (g *Graph[T]) Children(id string) []*Node[T]

func (*Graph[T]) Get

func (g *Graph[T]) Get(id string) *Node[T]

func (*Graph[T]) Has

func (g *Graph[T]) Has(nodeId string) bool

func (*Graph[T]) Nodes

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

func (*Graph[T]) Parents

func (g *Graph[T]) Parents(id string) []*Node[T]

type Node

type Node[T any] struct {
	Id     string
	Errors []error
	Data   T
}

func MakeNode

func MakeNode[T any](id string, data T) *Node[T]

func (*Node[T]) AddErrors

func (n *Node[T]) AddErrors(err ...error)

Jump to

Keyboard shortcuts

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