worker

package
v0.0.0-...-d4179d9 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2018 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Worker

type Worker interface {
	// Exec() is the heart of a worker. The main task of Exec() is to create a
	// "task.TaskResult" struct and send it to the "chan task.TaskResult". Use
	// "*ssh.Session" to handle the ssh connection.
	Exec(chan task.TaskResult, *ssh.Session)

	// SubTask() returns the sub-tasks if there's any.
	SubTask() []task.TaskDesc

	// NewWorker() intakes ONE "task.TaskDesc" and create a valid specific worker
	// which implements the Worker interface.
	NewWorker(task.TaskDesc) Worker

	// Timeout() returns the time duration for the task timeout.
	Timeout() time.Duration

	// Evaluate() is used for evaluating a taske.TaskResult's success/failure.
	Evaluate(task.TaskResult) error
}

Jump to

Keyboard shortcuts

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