Documentation ¶
Index ¶
- Variables
- func ApplyParamsToResourceTemplate(params []pipelinev1.Param, rt json.RawMessage) json.RawMessage
- func ApplyUIDToResourceTemplate(rt json.RawMessage, uid string) json.RawMessage
- func MergeBindingParams(bindings []*triggersv1.TriggerBinding) ([]pipelinev1.Param, error)
- func MergeInDefaultParams(params []pipelinev1.Param, paramSpecs []pipelinev1.ParamSpec) []pipelinev1.Param
- func ParseJSONPath(input interface{}, expr string) (string, error)
- func ResolveParams(bindings []*triggersv1.TriggerBinding, body []byte, header http.Header, ...) ([]pipelinev1.Param, error)
- func ResolveResources(template *triggersv1.TriggerTemplate, params []pipelinev1.Param) []json.RawMessage
- func TektonJSONPathExpression(expr string) (string, error)
- type ResolvedTrigger
Constants ¶
This section is empty.
Variables ¶
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
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
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.