dag

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DAG

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

func New

func New() *DAG

func (*DAG) Deferred

func (d *DAG) Deferred(ctx context.Context) error

func (DAG) Format

func (d DAG) Format() string

func (*DAG) Report

func (d *DAG) Report(r func(context.Context, NodeReport)) *DAG

func (*DAG) Run

func (d *DAG) Run(ctx context.Context) error

func (*DAG) With

func (d *DAG) With(nodes []Node) error

type Node

type Node struct {
	Name  string
	Wait  []chan struct{}
	Func  func(ctx context.Context, r Report) (Report, error)
	Defer func(ctx context.Context) error
	Done  chan struct{}
	// contains filtered or unexported fields
}

func Sub

func Sub(name string, nodes []Node) []Node

type NodeReport

type NodeReport struct {
	ID            string
	Name          string
	Sub           string
	Report        Report
	Duration      time.Duration
	TotalDuration time.Duration
}

type Report

type Report struct {
	Data map[string]any
}

func (Report) With

func (r Report) With(k string, v any) Report

Jump to

Keyboard shortcuts

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