executor

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2023 License: MIT Imports: 23 Imported by: 1

Documentation

Index

Constants

View Source
const DefaultArg = "isolator"

DefaultArg is the default CLI arg for starting the executor server.

Variables

This section is empty.

Functions

func ExecuteHandler added in v0.6.0

func ExecuteHandler(ctx context.Context, content interface{}, encode wire.EncoderFunc) error

ExecuteHandler is a standard handler handling Execute command.

func NewFlavour added in v0.6.3

func NewFlavour(config Config) run.FlavourFunc

NewFlavour returns a flavour catching a request to start the executor server. If command is not related, then the standard application function is called.

func RunDockerContainerHandler added in v0.9.0

func RunDockerContainerHandler(ctx context.Context, content interface{}, encode wire.EncoderFunc) error

RunDockerContainerHandler is a standard handler for RunDockerContainer command.

Types

type Config added in v0.6.0

type Config struct {
	// Roouter provide handlers for commands.
	Router Router

	// ExecutorArg is the CLI arg on calling binary which starts the executor server.
	// See `executor.Catch`.
	ExecutorArg string
}

Config is the config of executor server.

type EmbeddedFunc added in v0.10.0

type EmbeddedFunc func(ctx context.Context, args []string) error

EmbeddedFunc defines embedded function.

type HandlerFunc added in v0.6.0

type HandlerFunc func(ctx context.Context, content interface{}, encode wire.EncoderFunc) error

HandlerFunc defines handler for content.

func NewInflateDockerImageHandler added in v0.8.0

func NewInflateDockerImageHandler() HandlerFunc

NewInflateDockerImageHandler creates new standard handler for InflateDockerImage command.

func NewRunEmbeddedFunctionHandler added in v0.10.0

func NewRunEmbeddedFunctionHandler(funcs map[string]EmbeddedFunc) HandlerFunc

NewRunEmbeddedFunctionHandler returns new handler running embedded function.

type Router added in v0.6.0

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

Router maps content type to its handler.

func NewRouter added in v0.6.0

func NewRouter() Router

NewRouter returns new router.

func (Router) Handler added in v0.6.0

func (r Router) Handler(content interface{}) (HandlerFunc, error)

Handler returns handler for the content type.

func (Router) RegisterHandler added in v0.6.0

func (r Router) RegisterHandler(content interface{}, handler HandlerFunc) Router

RegisterHandler registers new handler for the content type.

func (Router) Types added in v0.6.0

func (r Router) Types() []interface{}

Types returns registered types.

Jump to

Keyboard shortcuts

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