exec

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindAndInterpolateAllKeys

func FindAndInterpolateAllKeys(input any, state Results) (any, error)

FindAndInterpolateAllKeys takes an `input` any value, and recursively identifies any values that should be replaced from `state`.

A value `v` should be replaced if it is wrapped as follows: `$(v)`.

func FindAndInterpolateEnvVars

func FindAndInterpolateEnvVars(input any, env Env) (any, error)

FindAndInterpolateEnv takes a `config` any value, and recursively identifies any values that should be replaced from `env`.

A value `v` should be replaced if it is wrapped as follows: `$(v)`.

func InterpolateKey

func InterpolateKey(key string, state Results) (any, error)

InterpolateKey takes a multi-part, dot-separated key and attempts to replace it with its corresponding value in `state`.

A key is valid if it contains at least two parts, with:

  • the first part being the workflow step's `ref` variable
  • the second part being one of `inputs` or `outputs`

If a key has more than two parts, then we traverse the parts to find the value we want to replace. We support traversing both nested maps and lists and any combination of the two.

Types

type Env

type Env struct {
	Binary  []byte
	Config  []byte
	Secrets map[string]string
}

type Result

type Result struct {
	Inputs  values.Value
	Outputs values.Value
	Error   error
}

type Results

type Results interface {
	ResultForStep(string) (*Result, bool)
}

Jump to

Keyboard shortcuts

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