executor

package
v0.0.0-...-f27324f Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrTaskNotExists is returned when we can't find specific task from istio
	ErrTaskNotExists = errors.New("task isn't exists")
)
View Source
var (
	// ErrUnknownCmd defines invalid command error
	ErrUnknownCmd = errors.New("unknown command")
)
View Source
var (
	// TaskStatusChM stores task execution result into a channel map
	TaskStatusChM = make(map[string]chan Task)
)

Functions

func GetOrAddTaskStatusChM

func GetOrAddTaskStatusChM(name string) chan Task

GetOrAddTaskStatusChM returns task channel from taskStatusChM group by operator, if channel is not exists, we makes a new one then return it.

func Init

func Init()

Init initializes executor package.

func Push2TaskStatusCh

func Push2TaskStatusCh(task Task)

Push2TaskStatusCh pushes task into taskStatusChM.

Types

type Executor

type Executor interface {
	Execute(Task) error
}

Executor will dispatch and execute task from channel.

var DefaultExecutor Executor

DefaultExecutor defines default task executor.

func NewCrdExecutor

func NewCrdExecutor() Executor

NewCrdExecutor returns a istiocrd executor.

type Task

type Task = model.Task

Task is an alias of model.Task

Jump to

Keyboard shortcuts

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