script

package
v0.0.0-...-f3f832b Latest Latest
Warning

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

Go to latest
Published: May 11, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command interface{}

Command is the top level interface for commands.

type ConcurrentCommand

type ConcurrentCommand []Command

ConcurrentCommand describes a set of commands that should be executed simultaneously.

func (*ConcurrentCommand) UnmarshalJSON

func (c *ConcurrentCommand) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON converts b to a ConcurrentCommand. b must be a JSON array of commands.

type InvalidCommandTypeError

type InvalidCommandTypeError struct {
	Command Command
}

InvalidCommandTypeError is returned when a type-switch on a Command does not reveal a known Command.

func (InvalidCommandTypeError) Error

func (e InvalidCommandTypeError) Error() string

type MultipleKeysInCommandMapError

type MultipleKeysInCommandMapError struct {
	CommandMap map[string]interface{}
}

MultipleKeysInCommandMapError is returned when there is more than one key in a command map.

func (MultipleKeysInCommandMapError) Error

type RequestCommand

type RequestCommand struct {
	ServiceName string `json:"service"`
	// Size is the number of bytes in the request body.
	Size size.ByteSize `json:"size"`
}

RequestCommand describes a command to send an HTTP request to another service.

var (
	// DefaultRequestCommand is used by UnmarshalJSON to set defaults.
	DefaultRequestCommand RequestCommand
)

func (*RequestCommand) UnmarshalJSON

func (c *RequestCommand) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON converts b to a RequestCommand. If b is a JSON string, it is set as c's ServiceName. If b is a JSON object, it's properties are mapped to c.

type Script

type Script []Command

Script is a list of commands to be sequentially executed.

func (Script) MarshalJSON

func (s Script) MarshalJSON() ([]byte, error)

MarshalJSON encodes the Script as a JSON array of JSON objects.

func (*Script) UnmarshalJSON

func (s *Script) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON converts b to a Script. b must be a JSON array of Commands.

type SleepCommand

type SleepCommand time.Duration

SleepCommand describes a command to pause for a duration.

func (SleepCommand) String

func (c SleepCommand) String() string

func (*SleepCommand) UnmarshalJSON

func (c *SleepCommand) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON converts a JSON object to a SleepCommand.

type UnknownCommandKeyError

type UnknownCommandKeyError struct {
	CommandKey string
}

UnknownCommandKeyError is returned when a command's key (i.e. "sleep") does not match a known command.

func (UnknownCommandKeyError) Error

func (e UnknownCommandKeyError) Error() string

Jump to

Keyboard shortcuts

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