deps

package
v0.42.3 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CircularDependencyError

type CircularDependencyError struct {
	Dependent  *Node
	Dependency *Node
}

func (CircularDependencyError) Error

func (e CircularDependencyError) Error() string

type MapNodeSet

type MapNodeSet map[*Node]struct{}

MapNodeSet is a Node set backed by a Go map (unordered). NOTE: DO *NOT* USE this for on-chain operations, but OrderedNodeSet

func (MapNodeSet) Add

func (m MapNodeSet) Add(node *Node)

func (MapNodeSet) Contains

func (m MapNodeSet) Contains(node *Node) bool

func (MapNodeSet) ForEach

func (m MapNodeSet) ForEach(f func(*Node) error) error

func (MapNodeSet) Remove

func (m MapNodeSet) Remove(node *Node)

type Node

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

func NewNode

func NewNode(value interface{}, newNodeSet func() NodeSet) *Node

func (*Node) AllDependents

func (n *Node) AllDependents() ([]*Node, error)

func (*Node) SetDependencies

func (n *Node) SetDependencies(dependencies ...*Node)

type NodeSet

type NodeSet interface {
	Add(*Node)
	Remove(*Node)
	Contains(*Node) bool
	ForEach(func(*Node) error) error
}

NodeSet is a set of Node

func NewMapNodeSet

func NewMapNodeSet() NodeSet

type OrderedNodeSet

type OrderedNodeSet orderedmap.OrderedMap[*Node, struct{}]

OrderedNodeSet is a Node set backed by an ordered map

func (*OrderedNodeSet) Add

func (os *OrderedNodeSet) Add(node *Node)

func (*OrderedNodeSet) Contains

func (os *OrderedNodeSet) Contains(node *Node) bool

func (*OrderedNodeSet) ForEach

func (os *OrderedNodeSet) ForEach(f func(*Node) error) error

func (*OrderedNodeSet) Remove

func (os *OrderedNodeSet) Remove(node *Node)

Jump to

Keyboard shortcuts

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