template

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UID = func() string { return rand.String(5) }

UID generates a random string like the Kubernetes apiserver generateName metafield postfix.

Functions

func ApplyParamsToResourceTemplate

func ApplyParamsToResourceTemplate(params []pipelinev1.Param, rt json.RawMessage) json.RawMessage

ApplyParamsToResourceTemplate returns the TriggerResourceTemplate with the param values substituted for all matching param variables in the template

func ApplyUIDToResourceTemplate

func ApplyUIDToResourceTemplate(rt json.RawMessage, uid string) json.RawMessage

ApplyUIDToResourceTemplate returns the TriggerResourceTemplate after uid replacement The same uid should be used per trigger to properly address resources throughout the TriggerTemplate.

func MergeBindingParams added in v0.2.0

func MergeBindingParams(bindings []*triggersv1.TriggerBinding) ([]pipelinev1.Param, error)

MergeBindingParams merges params across multiple bindings.

func MergeInDefaultParams

func MergeInDefaultParams(params []pipelinev1.Param, paramSpecs []pipelinev1.ParamSpec) []pipelinev1.Param

MergeInDefaultParams returns the params with the addition of all paramSpecs that have default values and are already in the params list

func ParseJSONPath added in v0.2.0

func ParseJSONPath(input interface{}, expr string) (string, error)

ParseJSONPath extracts a subset of the given JSON input using the provided JSONPath expression.

func ResolveParams added in v0.2.0

func ResolveParams(bindings []*triggersv1.TriggerBinding, body []byte, header http.Header, params []pipelinev1.ParamSpec) ([]pipelinev1.Param, error)

ResolveParams takes a given trigger binding and produces the resulting resource params.

func ResolveResources added in v0.2.0

func ResolveResources(template *triggersv1.TriggerTemplate, params []pipelinev1.Param) []json.RawMessage

ResolveResources resolves a templated resource by replacing params with their values.

func TektonJSONPathExpression added in v0.2.0

func TektonJSONPathExpression(expr string) (string, error)

TektonJSONPathExpression returns a valid JSONPath expression. It accepts a "RelaxedJSONPath" expression that is wrapped in the Tekton variable interpolation syntax i.e. $(). RelaxedJSONPath expressions can optionally omit the leading curly braces '{}' and '.'

Types

type ResolvedTrigger added in v0.2.0

type ResolvedTrigger struct {
	TriggerBindings []*triggersv1.TriggerBinding
	TriggerTemplate *triggersv1.TriggerTemplate
}

ResolvedTrigger contains the dereferenced TriggerBindings and TriggerTemplate after resolving the k8s ObjectRef.

func ResolveTrigger added in v0.2.0

func ResolveTrigger(trigger triggersv1.EventListenerTrigger, getTB getTriggerBinding, getTT getTriggerTemplate) (ResolvedTrigger, error)

ResolveTrigger takes in a trigger containing object refs to bindings and templates and resolves them to their underlying values.

Jump to

Keyboard shortcuts

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