Documentation
¶
Index ¶
- Variables
- type Entry
- type Executor
- type Layer
- type Node
- type TreeLayer
- func (t *TreeLayer[K, V]) Add(entries ...Executor[K, V]) error
- func (t *TreeLayer[K, V]) AsyncCount(layer int) int
- func (t *TreeLayer[K, V]) Execute(ctx context.Context, executor func(ctx context.Context, k K, n V))
- func (t *TreeLayer[K, V]) GetLayersCount() int
- func (t *TreeLayer[K, V]) GetNodeDependencies(key K) []K
- func (t *TreeLayer[K, V]) GetNodeKeys() []K
- func (t *TreeLayer[K, V]) GetNodesInLayer(layer int) int
- func (t *TreeLayer[K, V]) GetPretty() string
- func (t *TreeLayer[K, V]) Layers() int
- func (t *TreeLayer[K, V]) Retrieve(layer int) (async chan *Node[K, V], sync chan *Node[K, V])
- func (t *TreeLayer[K, V]) SyncCount(layer int) int
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrCircuitDependency = errors.New("circuit dependency")
Functions ¶
This section is empty.
Types ¶
type Entry ¶
type Entry[K comparable, V any] struct { // contains filtered or unexported fields }
type Executor ¶
type Executor[K comparable, V any] interface { Key() K Value() V IsAsync() bool DependsOn() []K }
type Layer ¶
type Layer[K comparable, V any] struct { Nodes []*Node[K, V] AsyncCount int SyncCount int }
type Node ¶
type Node[K comparable, V any] struct { // contains filtered or unexported fields }
func (*Node[K, V]) SetVisited ¶
type TreeLayer ¶
type TreeLayer[K comparable, V any] struct { // contains filtered or unexported fields }
func NewTreeLayer ¶
func NewTreeLayer[K comparable, V any]() *TreeLayer[K, V]
func (*TreeLayer[K, V]) AsyncCount ¶
func (*TreeLayer[K, V]) GetLayersCount ¶
GetLayersCount returns the number of layers in the tree
func (*TreeLayer[K, V]) GetNodeDependencies ¶
func (t *TreeLayer[K, V]) GetNodeDependencies(key K) []K
GetNodeDependencies returns the dependencies of a given node
func (*TreeLayer[K, V]) GetNodeKeys ¶
func (t *TreeLayer[K, V]) GetNodeKeys() []K
GetNodeKeys returns all the keys of nodes in the tree
func (*TreeLayer[K, V]) GetNodesInLayer ¶
GetNodesInLayer returns the number of nodes in a specific layer
Click to show internal directories.
Click to hide internal directories.