types

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: May 9, 2018 License: Apache-2.0 Imports: 4 Imported by: 14

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NoStop

type NoStop struct{}

NoStop implements the Stop() method from the types.Task interface. It can be used by tasks that don't do anything during the `stop` phase of execution.

func (*NoStop) Stop

func (t *NoStop) Stop(_ *context.ExecuteContext) error

Stop does nothing

type RunFunc

type RunFunc func(*context.ExecuteContext, bool) (bool, error)

RunFunc is a function which performs the task. It received a context and a bool indicating if any dependencies were modified. It should return true if the resource was modified, otherwise false.

type Task

type Task interface {
	logging.LogRepresenter
	Name() task.Name
	Run(*context.ExecuteContext, bool) (bool, error)
	Stop(*context.ExecuteContext) error
}

Task interface performs some operation with a resource config

type TaskBuilder

type TaskBuilder func(task.Name, config.Resource) Task

TaskBuilder is a function which creates a new Task from a name and config

type TaskConfig

type TaskConfig interface {
	Name() task.Name
	Resource() config.Resource
	Dependencies() []string
	Task(config.Resource) Task
}

TaskConfig is a data object which stores the full configuration of a Task

func NewTaskConfig

func NewTaskConfig(
	name task.Name,
	resource config.Resource,
	deps func() []string,
	buildTask TaskBuilder,
) TaskConfig

NewTaskConfig returns a TaskConfig from components

Jump to

Keyboard shortcuts

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