types

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2021 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Factory = map[Kind]CreateFn{}

Functions

func MustRegister

func MustRegister(kind Kind, create CreateFn)

func Register

func Register(kind Kind, create CreateFn) error

Types

type CreateFn

type CreateFn func(name Name, clusterName string, cluster apistructs.ClusterInfo) (TaskExecutor, error)

type Kind

type Kind string

Kind return the task executor type

func (Kind) String

func (k Kind) String() string

type Name

type Name string

Name return the task executor name

func (Name) String

func (n Name) String() string

type TaskExecutor

type TaskExecutor interface {
	Kind() Kind
	Name() Name

	Status(ctx context.Context, task *spec.PipelineTask) (apistructs.StatusDesc, error)
	Create(ctx context.Context, task *spec.PipelineTask) (interface{}, error)
	Remove(ctx context.Context, task *spec.PipelineTask) (interface{}, error)
	BatchDelete(ctx context.Context, tasks []*spec.PipelineTask) (interface{}, error)
	Inspect(ctx context.Context, task *spec.PipelineTask) (apistructs.TaskInspect, error)
}

Jump to

Keyboard shortcuts

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