workflow

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TEMPLATE_FUNCTIONS = template.FuncMap{
	"replace": func(s, old, new string) string {
		return strings.Replace(s, old, new, -1)
	},
	"date": func(format string) string {
		return time.Now().Format(format)
	},
	"join": func(s1, s2, sep string) string {
		if len(s1) == 0 {
			return s2
		}
		if len(s2) == 0 {
			return s1
		}
		return s1 + sep + s2
	},
	"trimSpace": func(s string) string {
		return strings.TrimSpace(s)
	},
	"isTrue":  isTrue,
	"isFalse": isFalse,
}

Functions

func ExecuteWorkflow

func ExecuteWorkflow(workflow *exec.Workflow) error

func Template

func Template(input string, env exec.Env) (string, error)

Types

type Runtime

type Runtime struct {
	Env    exec.Env
	Config config.Runtime
}

func GetRuntime

func GetRuntime(env exec.Env, runtimes []config.Runtime, name string) (*Runtime, error)

func (*Runtime) Execute

func (r *Runtime) Execute(interactive bool, command string, stdin io.Reader, stdout, stderr *bytes.Buffer) error

func (*Runtime) GetCommand added in v0.0.6

func (r *Runtime) GetCommand(interactive bool, cmd string) (string, error)

Jump to

Keyboard shortcuts

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