task

package
v0.6.0-next.7 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(agent *models.Node) error

Init initializes the agent queues.

func NewTask

func NewTask(taskJSON []byte) (*models.Task, error)

NewTask creates a new task.

func RegisterAgentHandlers

func RegisterAgentHandlers(r pure.IRouteGroup)

RegisterAgentHandlers registers the handler for receiving information from agents.

func RegisterHandlers

func RegisterHandlers(r pure.IRouteGroup)

RegisterHandlers registers the handlers for the task module.

func RegisterUIHandlers

func RegisterUIHandlers(r pure.IRouteGroup)

RegisterUIHandlers registers the HTTP handlers for the task UI.

func UITaskNew

func UITaskNew(w http.ResponseWriter, r *http.Request)

UITaskNew returns the form for creating a new task.

Types

type List

type List struct{ list.List }

List implements List type as well as the json.Marshaler interface.

func (*List) MarshalJSON

func (l *List) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface.

type Plugin

type Plugin interface {
	// GetCommand returns the command to run the server.
	GetCommand(task models.Task) (string, error)

	// GetFetchCommand returns a command to run which will be used to fetch relevant information about the node, and a callback that returns JSON metadata to send the output too.
	GetFetchCommand() (string, func([]string) ([]byte, error))

	// GetInputs takes the JSON metadata and returns a JSON that can be converted to a ui.Form object.
	GetInputs([]byte) ([]byte, error)

	// GetUUID returns the UUID of the plugin.
	GetUUID() string
}

Plugin defines the interface for Task module plugins.

Jump to

Keyboard shortcuts

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