dag

package
v0.2.134 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2019 License: BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const ResultChanLength = 10

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionResult

type ActionResult struct {
	Name string
	Err  error
}

type DAG

type DAG struct {
	Tasks map[string]*Task `yaml:"tasks"`
}

func (*DAG) AddTask

func (d *DAG) AddTask(name string, task, rollback func(context.Context, io.Writer) error, dependsOn []string) error

func (DAG) Check

func (d DAG) Check() error

topological sort 実際遅いけどもういいや O(E^2 + V)

func (DAG) Do

func (d DAG) Do(ctx context.Context, out io.Writer) error

出力で時間を出したほうがよさそう

type Task

type Task struct {
	DependsOn []string `yaml:"depends_on"`
	// contains filtered or unexported fields
}

func (Task) Rollback

func (n Task) Rollback(ctx context.Context, out io.Writer) error

func (Task) Run

func (n Task) Run(ctx context.Context, out io.Writer) error

type TaskErrors

type TaskErrors struct {
	RunErrors      map[string]error
	RollbackErrors map[string]error
}

func (TaskErrors) Error

func (d TaskErrors) Error() string

Jump to

Keyboard shortcuts

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