task

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: Apache-2.0 Imports: 13 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BadSpec = errors.New("invalid service spec")
)

Functions

This section is empty.

Types

type Action

type Action int
const (
	TaskCreate Action = iota
	TaskDestroy
	TaskStatus
	TaskRemove
	TaskUpdate
	TaskInspect
	TaskCancel
	TaskPrecheck
	TaskJobVolumeCreate
	TaskKillPod
	TaskScale
)

func (*Action) String

func (a *Action) String() string

type Result

type Result interface {
	Wait(ctx context.Context) TaskResponse
}

type Sched

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

func NewSched

func NewSched() (*Sched, error)

func (*Sched) FindExecutor

func (s *Sched) FindExecutor(name, kind string) (executortypes.Executor, error)

func (*Sched) ListExecutors

func (s *Sched) ListExecutors() []executortypes.Executor

func (*Sched) PrintPoolUsage

func (s *Sched) PrintPoolUsage()

func (*Sched) Return

func (s *Sched) Return(ctx context.Context, t *Task, resp TaskResponse)

func (*Sched) Send

func (s *Sched) Send(ctx context.Context, req TaskRequest) (Result, error)

type Task

type Task struct {
	TaskRequest
	// contains filtered or unexported fields
}

func (*Task) Run

func (t *Task) Run(ctx context.Context) TaskResponse

func (*Task) String

func (t *Task) String() string

func (*Task) Wait

func (t *Task) Wait(ctx context.Context) TaskResponse

type TaskRequest

type TaskRequest struct {
	Spec         interface{}
	ExecutorKind string
	ExecutorName string
	ID           string
	Action       Action
}

type TaskResponse

type TaskResponse struct {
	Extra interface{}
	// contains filtered or unexported fields
}

func (*TaskResponse) Err

func (tr *TaskResponse) Err() error

func (*TaskResponse) Status

func (tr *TaskResponse) Status() apistructs.StatusDesc

Jump to

Keyboard shortcuts

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