executors

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error

func Error(err error) executorResultOption

func ErrorString

func ErrorString(err string) executorResultOption

func Output

func Output(m map[string]any) executorResultOption

func Status

func Status(s pb.TaskExecutionResponseMessage_TaskState) executorResultOption

Types

type Context

type Context interface {
	GetString(k string) string
	GetRequiredString(k string) (string, error)
	GetNumber(k string) (uint64, error)
	GetRequiredNumber(k string) (uint64, error)
	GetMap(k string) (map[string]string, error)
	GetList(k string) ([]string, error)
	GetBoolean(k string) (bool, error)
	GetInput() cache.MapCache[string, string]
	GetStore() cache.MapCache[string, string]
}

type Enumer

type Enumer interface {
	fmt.Stringer
	Ordinal() uint
}

type Executor

type Executor interface {
	Execute(ctx ExecutorContext) *ExecutorResult
}

type ExecutorContext

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

func NewExecutorContext

func NewExecutorContext(input map[string]string, store map[string]string) ExecutorContext

func (*ExecutorContext) GetBoolean

func (e *ExecutorContext) GetBoolean(k string) (bool, error)

func (*ExecutorContext) GetInput added in v0.0.1

func (e *ExecutorContext) GetInput() cache.MapCache[string, string]

func (*ExecutorContext) GetList

func (e *ExecutorContext) GetList(k string) ([]string, error)

func (*ExecutorContext) GetMap

func (e *ExecutorContext) GetMap(k string) (map[string]string, error)

func (*ExecutorContext) GetNumber

func (e *ExecutorContext) GetNumber(k string) (uint64, error)

func (*ExecutorContext) GetRequiredNumber

func (e *ExecutorContext) GetRequiredNumber(k string) (uint64, error)

func (*ExecutorContext) GetRequiredString

func (e *ExecutorContext) GetRequiredString(k string) (string, error)

func (*ExecutorContext) GetStore

func (e *ExecutorContext) GetStore() cache.MapCache[string, string]

func (*ExecutorContext) GetString

func (e *ExecutorContext) GetString(k string) string

type ExecutorCreationError

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

func NewExecutorCreationError

func NewExecutorCreationError(t pb.TaskType) *ExecutorCreationError

func (*ExecutorCreationError) Error

func (err *ExecutorCreationError) Error() string

type ExecutorResult

type ExecutorResult struct {
	Output map[string]any
	Status pb.TaskExecutionResponseMessage_TaskState
	Error  string
}

func NewExecutorResult

func NewExecutorResult(opts ...executorResultOption) *ExecutorResult

type ExecutorStatus

type ExecutorStatus uint
const (
	ExecutorStatus_UNKNOWN ExecutorStatus = iota
	ExecutorStatus_COMPLETED
	ExecutorStatus_FAILED_RETRYABLE
	ExecutorStatus_FAILED_NON_RETRYABLE
)

func (ExecutorStatus) Ordinal

func (es ExecutorStatus) Ordinal() uint

func (ExecutorStatus) String

func (es ExecutorStatus) String() string

type ExecutorType

type ExecutorType uint
const (
	ExecutorType_UNKNOWN ExecutorType = iota
	ExecutorType_VOID
	ExecutorType_HTTP
	ExecutorType_SCRIPT
	ExecutorType_KUBERNETES_API_REQUEST
)

func (ExecutorType) Ordinal

func (e ExecutorType) Ordinal() uint

func (ExecutorType) String

func (t ExecutorType) String() string

type InvalidHttpMethodError

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

func NewInvalidHttpMethodError

func NewInvalidHttpMethodError(m string) *InvalidHttpMethodError

func (*InvalidHttpMethodError) Error

func (err *InvalidHttpMethodError) Error() string

type NonRetryableError

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

func NewNonRetryableError

func NewNonRetryableError(msg string) *NonRetryableError

func (*NonRetryableError) Error

func (err *NonRetryableError) Error() string

func (*NonRetryableError) Unwrap

func (err *NonRetryableError) Unwrap() error

func (*NonRetryableError) WithCause

func (err *NonRetryableError) WithCause(e error) *NonRetryableError

type RequiredKeyValidationError

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

func NewRequiredKeyValidationError

func NewRequiredKeyValidationError(key string) *RequiredKeyValidationError

func (*RequiredKeyValidationError) Error

func (err *RequiredKeyValidationError) Error() string

type RetryableError

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

func NewRetryableError

func NewRetryableError(msg string) *RetryableError

func (*RetryableError) Error

func (err *RetryableError) Error() string

func (*RetryableError) Unwrap

func (err *RetryableError) Unwrap() error

func (*RetryableError) WithCause

func (err *RetryableError) WithCause(e error) *RetryableError

Directories

Path Synopsis
tls

Jump to

Keyboard shortcuts

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