command

package
v0.0.0-...-366f0b0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2019 License: Apache-2.0 Imports: 44 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PASS = "PASS"
	FAIL = "FAIL"
	SKIP = "SKIP"
)

Variables

This section is empty.

Functions

func RegisterCommand

func RegisterCommand(name string, factory CommandFactory) error

func RegisteredCommandNames

func RegisteredCommandNames() []string

func ToModelTestResults

func ToModelTestResults(results []*goTestResult) task.LocalTestResults

ToModelTestResults converts the implementation of LocalTestResults native to the goTest plugin to the implementation used by MCI tasks

Types

type Command

type Command interface {
	// ParseParams takes a map of fields to values extracted from
	// the project config and passes them to the command. Any
	// errors parsing the information are returned.
	ParseParams(params map[string]interface{}) error

	// Execute runs the command using the agent's logger, communicator,
	// task config, and a channel for interrupting long-running commands.
	// Execute is called after ParseParams.
	Execute(context.Context, client.Communicator, client.LoggerProducer, *model.TaskConfig) error

	// A string name for the command
	Name() string

	// Type reports on or overrides the default command type
	// (e.g. system or task.) The setter MUST NOT override a value
	// if it has already been set.
	Type() string
	SetType(string)

	DisplayName() string
	SetDisplayName(string)

	IdleTimeout() time.Duration
	SetIdleTimeout(time.Duration)

	SetJasperManager(jasper.Manager)
	JasperManager() jasper.Manager
}

Command is an interface that defines a command A Command takes parameters as a map, and is executed after those parameters are parsed.

func Render

type CommandFactory

type CommandFactory func() Command

func GetCommandFactory

func GetCommandFactory(name string) (CommandFactory, bool)

Jump to

Keyboard shortcuts

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