invokers

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const BLANK string = ""
View Source
const MAIN_RESOURCE string = ":default-resource:"

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandDescriptor

type CommandDescriptor struct {
	CommandString    string     `json:"command"`
	ExecutionTimeout TimeSecond `json:"timeout"`
	// contains filtered or unexported fields
}

type CommandEntrypoint

type CommandEntrypoint struct {
	Default        *CommandDescriptor            `json:"default"`
	Methods        map[string]*CommandDescriptor `json:"methods"`
	Settings       map[string]interface{}        `json:"settings"`
	SettingsFormat string                        `json:"settings-format"`
	// contains filtered or unexported fields
}

type CommandInvocation

type CommandInvocation struct {
	Envs             []string
	PriorCommand     string
	ResourceName     string
	MethodName       string
	ExecutionTimeout TimeSecond
}

type ExecutionState

type ExecutionState struct {
	IsTimeout bool
	Duration  time.Duration
}

type Executor

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

func NewExecutor

func NewExecutor(opts *ExecutorOptions) (*Executor, error)

func (*Executor) GetNewPipeChain added in v1.0.4

func (e *Executor) GetNewPipeChain() func() PipeChainRunner

func (*Executor) Register

func (e *Executor) Register(descriptor *CommandDescriptor, names ...string) error

func (*Executor) Run

func (*Executor) RunOnRawData

func (e *Executor) RunOnRawData(opts *CommandInvocation, inData []byte) ([]byte, []byte, *ExecutionState, error)

func (*Executor) StoreSettings added in v1.0.4

func (e *Executor) StoreSettings(prefix string, settings map[string]interface{}, format string, resourceName string) error

type ExecutorOptions

type ExecutorOptions struct {
	DefaultCommand *CommandDescriptor
}

type PipeChain

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

func (*PipeChain) Run

func (p *PipeChain) Run(ib *bytes.Buffer, ob *bytes.Buffer, eb *bytes.Buffer, chain ...*exec.Cmd) error

func (*PipeChain) Stop

func (p *PipeChain) Stop()

type PipeChainRunner added in v1.0.4

type PipeChainRunner interface {
	Run(ib *bytes.Buffer, ob *bytes.Buffer, eb *bytes.Buffer, chain ...*exec.Cmd) error
	Stop()
}

type TimeSecond added in v1.0.2

type TimeSecond int

Jump to

Keyboard shortcuts

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