nodetype

package
v0.0.0-...-817c61a Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2018 License: MIT Imports: 15 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("executable file not found in $PATH")

ErrNotFound is the error resulting if a path search failed to find an executable file.

Functions

This section is empty.

Types

type NType

type NType string

NType are the node types

const (
	NtEnd         NType = "end" // the special end node
	NtData        NType = "data"
	NtTimer       NType = "timer"
	NtExec        NType = "exec"
	NtFetch       NType = "fetch"
	NtGitMerge    NType = "git-merge"
	NtGitCheckout NType = "git-checkout"
)

NType reserved node types

type NodeType

type NodeType interface {
	Match(Opts, Opts) bool
	Execute(ws *Workspace, in Opts, output chan string) (int, Opts, error)
}

NodeType is the interface for a node. All implementations on NodeType are stateless THe Execute method must be a pure(ish) function operating on in and returning an out Opts

func GetNodeType

func GetNodeType(ty string) NodeType

GetNodeType returns the node from the given the type and opts

type Opts

type Opts map[string]interface{}

Opts are the options on the node type that will be compared to those on the event

func MergeOpts

func MergeOpts(l, r Opts) Opts

MergeOpts merges l and r into a new Opts struct, r taking precedence

func (*Opts) Fixup

func (o *Opts) Fixup()

Fixup allows the receiver to be able to be rendered as json

type Workspace

type Workspace struct {
	BasePath   string // The root path for this workspace
	FetchCache string // The host level cache of downloaded files (not per workspace, but handy to have listed in this struct)
}

Workspace is anything specific to a workspace for a single run or any locations common between runs

Jump to

Keyboard shortcuts

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