models

package
v1.1.9 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2021 License: MIT Imports: 1 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExpectSpec

type ExpectSpec map[string]ExpectSpecEntry

ExpectSpec ...

type ExpectSpecEntry

type ExpectSpecEntry struct {
	Type  string      `json:"type"`
	Value interface{} `json:"value"`
}

ExpectSpecEntry ...

type FinalDefinitions

type FinalDefinitions struct {
	Function string                 `json:"function,omitempty"`
	Args     map[string]interface{} `json:"args,omitempty"`
}

FinalDefinitions are run after finishing running each bot

type InitialDefinitions

type InitialDefinitions struct {
	Function string                 `json:"function,omitempty"`
	Args     map[string]interface{} `json:"args,omitempty"`
}

InitialDefinitions are set before running each bot

type Operation

type Operation struct {
	Type    string                 `json:"type"`
	Timeout int                    `json:"timeout,omitempty"`
	URI     string                 `json:"uri"`
	Args    map[string]interface{} `json:"args"`
	Expect  ExpectSpec             `json:"expect,omitempty"`
	Store   StoreSpec              `json:"store,omitempty"`
	Change  map[string]interface{} `json:"change,omitempty"`
}

Operation defines an operation the bot may execute

func (*Operation) Validate added in v1.1.9

func (o *Operation) Validate() error

Validate returns an error if the operation is malformed TODO -- more validations

type Spec

type Spec struct {
	Name                 string              `json:"name"`
	NumberOfInstances    int                 `json:"numberOfInstances"`
	PreRun               *InitialDefinitions `json:"preRun,omitempty"`
	SequentialOperations []*Operation        `json:"sequentialOperations,omitempty"`
	PostRun              *FinalDefinitions   `json:"postRun,omitempty"`
}

Spec defines the bots' spec

func NewSpec added in v0.2.0

func NewSpec(name string) *Spec

NewSpec returns a new spec

type StoreSpec

type StoreSpec map[string]StoreSpecEntry

StoreSpec ...

type StoreSpecEntry

type StoreSpecEntry struct {
	Type  string `json:"type"`
	Value string `json:"value"`
}

StoreSpecEntry ...

Jump to

Keyboard shortcuts

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