task

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2023 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const HTTP2_GOAWAY_CHECK = "http2: server sent GOAWAY and closed the connection"

Variables

View Source
var (
	ErrNotTask = errors.New("not a task")
)

Functions

func LookupAction

func LookupAction(v *cue.Value) (string, *cue.Value)

lookup action type in cue

func Register

func Register(typ string, f NewFunc)

Register a task type and initializer

func Then

func Then(ctx context.Context, v *cue.Value) error

do then action

Types

type NewFunc

type NewFunc func() Task

type State

type State int8

State is the state of the task.

const (
	// state order is important here since it defines the  order
	// on how states can transition only forwards
	// computing > completed > canceled > failed
	StateComputing State = iota
	StateSkipped
	StateCompleted
	StateCanceled
	StateFailed
)

func ParseState

func ParseState(s string) (State, error)

func (State) CanTransition

func (s State) CanTransition(t State) bool

func (State) String

func (s State) String() string

type Stdout added in v0.5.11

type Stdout struct {
}

func (*Stdout) Name added in v0.5.11

func (t *Stdout) Name() string

func (*Stdout) Run added in v0.5.11

func (t *Stdout) Run(ctx context.Context, v *cue.Value) (*cue.Value, error)

type Task

type Task interface {
	Run(ctx context.Context, v *cue.Value) (*cue.Value, error)
	Name() string
}

return result

func Lookup

func Lookup(v *cue.Value) (Task, error)

find action type by path

func New

func New(typ string) Task

New creates a new Task of the given type.

Jump to

Keyboard shortcuts

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