runtime

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2019 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Runtime

type Runtime struct {
	Values map[string]string
	// contains filtered or unexported fields
}

Runtime encapsulates the state of the tool

func New

func New(values map[string]string, c *docker.Client, workDir string) Runtime

New creates a new Runtime and returns it. This new context uses the working dir that is passed as a parameter. After instantiation, the context will be ready to load additional files.

func (*Runtime) HasTask

func (inv *Runtime) HasTask(taskID string) bool

HasTask tells whether the receiver has a task with the given task ID, i.e. whether any steps have been registered for that name.

func (*Runtime) RunFile

func (inv *Runtime) RunFile(fileName string) error

RunFile runs the file with the given filename in this context

func (*Runtime) RunLiterateFile

func (inv *Runtime) RunLiterateFile(filename string) error

RunLiterateFile interprets the given file as literate Markdown with intermixed Lua code and runs that code.

func (*Runtime) RunString

func (inv *Runtime) RunString(script string) error

RunString runs the given parameter directly

func (*Runtime) RunTask

func (inv *Runtime) RunTask(taskID string) error

RunTask executes the task with the given ID. It is perfectly fine to execute a task without any steps, but a warning will be shown. Any error that occurs during task processing is returned.

func (*Runtime) TaskIDList

func (inv *Runtime) TaskIDList() []string

TaskIDList gives back a list of tasks that are defined at the time of calling

type Step

type Step interface {
	Take(i *Runtime) error

	// ShowStartInfo displays some information on the default logger that identifies the step
	ShowStartInfo()
}

Step represents one action taken by the tool.

func DecodeWrapStep

func DecodeWrapStep(in string) Step

DecodeWrapStep unmarshals the wrap step encoded in in (in JSON), and gives it back. This function panics if there are errors during decoding.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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