resultref

package
v0.63.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// ResultStepPart Constant used to define the "steps" part of a step result reference
	ResultStepPart = "steps"
	// ResultTaskPart Constant used to define the "tasks" part of a pipeline result reference
	ResultTaskPart = "tasks"
	// ResultFinallyPart Constant used to define the "finally" part of a pipeline result reference
	ResultFinallyPart = "finally"
	// ResultResultPart Constant used to define the "results" part of a pipeline result reference
	ResultResultPart = "results"
)

Variables

View Source
var StepResultRegex = regexp.MustCompile(stepResultUsagePattern)

StepResultRegex compiles the regex pattern for the usage of step results.

Functions

func LooksLikeResultRef

func LooksLikeResultRef(expression string) bool

LooksLikeResultRef attempts to check if the given string looks like it contains any result references. Returns true if it does, false otherwise

func ParseResultName

func ParseResultName(resultName string) (string, string)

ParseResultName parse the input string to extract resultName and result index. Array indexing: Input: anArrayResult[1] Output: anArrayResult, "1" Array star reference: Input: anArrayResult[*] Output: anArrayResult, "*"

Types

type ParsedResult

type ParsedResult struct {
	ResourceName string
	ResultName   string
	ResultType   string
	ArrayIdx     *int
	ObjectKey    string
}

ParsedResult captures the task/step name, result name, type, array idx (in case of array result) and object key (in case of an object result). This is generated by parsing expressions that use $(tasks.taskName.results.resultName...) or $(steps.stepName.results.resultName...)

func ParseStepExpression

func ParseStepExpression(substitutionExpression string) (ParsedResult, error)

ParseStepExpression parses the input string and searches for the use of step result usage.

func ParseTaskExpression

func ParseTaskExpression(substitutionExpression string) (ParsedResult, error)

ParseTaskExpression parses the input string and searches for the use of task result usage.

Jump to

Keyboard shortcuts

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