expression

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const InterpolateClose = "}}"
View Source
const InterpolateOpen = "${{"

Variables

This section is empty.

Functions

func DigObject

func DigObject(object any, key string) (any, error)

func DigProtoValue

func DigProtoValue(object any, key string) (*structpb.Value, error)

func Evaluate

func Evaluate(obj any, s string) (*context.Value, error)

func Expand

func Expand(obj *InterpolationContext, value *structpb.Value) (*context.Value, error)

The Expand rewrites struct/list/string mutating data structure

func ExpandString

func ExpandString(obj *InterpolationContext, value string) (string, error)

The ExpandString rewrites string and returns string

func ObjectToProtoValue

func ObjectToProtoValue(object any) (*structpb.Value, error)

func ValueToString

func ValueToString(v *structpb.Value) (string, error)

Types

type InterpolationContext

type InterpolationContext struct {
	Env         map[string]string          `json:"env"`
	ExportFile  string                     `json:"export_file"`
	Inputs      map[string]*structpb.Value `json:"inputs"`
	Job         map[string]string          `json:"job"`
	OutputFile  string                     `json:"output_file"`
	StepDir     string                     `json:"step_dir"`
	StepResults map[string]*StepResultView `json:"steps"`
	WorkDir     string                     `json:"work_dir"`
}

InterpolationContext contains fields that can be accessed by expressions.

type StepResultView

type StepResultView struct {
	Outputs map[string]*structpb.Value `json:"outputs"`
}

Jump to

Keyboard shortcuts

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