invokers

package
v1.0.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const BLANK string = ""
View Source
const DEFAULT_COMMAND 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 {
	Common  *CommandDescriptor            `json:"common"`
	Methods map[string]*CommandDescriptor `json:"methods"`
}

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) 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)

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) (err error)

func (*PipeChain) Stop

func (p *PipeChain) 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