task

package
v0.11.34 Latest Latest
Warning

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

Go to latest
Published: May 31, 2025 License: MIT Imports: 9 Imported by: 3

Documentation

Index

Constants

View Source
const PluginTypeTask plugin.Type = "task"

Variables

This section is empty.

Functions

This section is empty.

Types

type Cfg

type Cfg struct {
	ID              string         `json:"id"              validate:"required" yaml:"id"`
	Type            Type           `json:"type"            validate:"required" yaml:"type"`
	Steps           []*step.Cfg    `json:"steps"           validate:"required" yaml:"steps"`
	DeferSteps      []*step.Cfg    `json:"deferSteps"      yaml:"deferSteps"`
	CurStepIdx      int            `json:"curStepIdx"      yaml:"curStepIdx"`
	CurDeferStepIdx int            `json:"curDeferStepIdx" yaml:"curDeferStepIdx"`
	Pool            string         `json:"pool"            yaml:"pool"`
	Values          map[string]any `json:"values"          yaml:"values"`
}

func NewCfg

func NewCfg() *Cfg

func (*Cfg) Add

func (c *Cfg) Add(typ step.Type, cfg any) *Cfg

func (*Cfg) Defer

func (c *Cfg) Defer(typ step.Type, cfg any) *Cfg

func (*Cfg) SetID

func (c *Cfg) SetID(id string) *Cfg

func (*Cfg) SetType

func (c *Cfg) SetType(t Type) *Cfg

type Collector

type Collector func(*Task) any

type Hook added in v0.7.1

type Hook func(*Task, error, *HookExtraData)

type HookExtraData added in v0.7.1

type HookExtraData struct {
	Wait bool
}

type Result added in v0.7.3

type Result struct {
	Data           map[string]any   `json:"data"           yaml:"data"`
	StepsData      []map[string]any `json:"stepsData"      yaml:"stepsData"`
	DeferStepsData []map[string]any `json:"deferStepsData" yaml:"deferStepsData"`
}

type StepHook added in v0.7.1

type StepHook func(*Task, int, step.Step)

type Task

type Task struct {
	runner.Runner
	*Cfg
	// contains filtered or unexported fields
}

func New

func New() *Task

func (*Task) CurDeferStep

func (t *Task) CurDeferStep() step.Step

func (*Task) DeferSteps

func (t *Task) DeferSteps() []step.Step

func (*Task) HookDeferStepDone added in v0.9.25

func (t *Task) HookDeferStepDone(hook ...StepHook)

func (*Task) HookStepDone added in v0.9.25

func (t *Task) HookStepDone(hook ...StepHook)

func (*Task) Init

func (t *Task) Init() error

func (*Task) Result

func (t *Task) Result() *Result

func (*Task) Start

func (t *Task) Start() error

func (*Task) Steps

func (t *Task) Steps() []step.Step

func (*Task) Stop

func (t *Task) Stop() error

func (*Task) Store added in v0.0.3

func (t *Task) Store(k string, v any)

type Type

type Type string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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