tasks

package
v0.0.0-...-c28e91b Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeDeleteTestData = "DeleteTestData"
	TypeDownloadAsset  = "DownloadAsset"
	TypeKeyValue       = "KeyValue"
	TypeSetGroup       = "SetGroup"
	TypeInstallTestRun = "InstallTestRun"
	TypeExecuteTestRun = "ExecuteTestRun"
)

Task type constants

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseTask

type BaseTask struct {
	Type string `json:"type"`
}

BaseTask is a struct that is intended to be embedded by specific task structs. Both of these in conjunction are used primarily to house the JSON message for passing tasks over the comms package (i.e. message queue), but may also contain important dependencies of the task, such as an HTTP handler.

type DeleteTestData

type DeleteTestData struct {
	BaseTask
	TestUUID string `json:"key"`
}

DeleteTestData embeds BaseTask and adds the necessary fields to transport a DeleteTestData task through comms

func NewDeleteTestData

func NewDeleteTestData(uuid string) *DeleteTestData

NewDeleteTestData returns a new DeleteTestData tasks.

func (*DeleteTestData) Run

Run contains the logic necessary to perform this task on the agent.

type DownloadAsset

type DownloadAsset struct {
	BaseTask
	Assets []string `json:"assets"`
}

DownloadAsset defines this particular task. It contains definitions not only for the task message, but also HTTPClient, filesystem, and i/o system abstractions to be more conducive to unit testing.

func NewDownloadAsset

func NewDownloadAsset(assets []string) *DownloadAsset

NewDownloadAsset returns a new DownloadAsset task.

func (*DownloadAsset) Run

Run contains the logic necessary to perform this task on the agent. This particular task will download all required assets, copy them into the appropriate directory, and ensure that the execute permission is given to each collector file.