corefunctions

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SupportedDateTimeFormats = []string{"unix", "rfc3339", "tag", "tagcompact"}

SupportedDateTimeFormats is a list of valid date/time formats supported by the DateTimeFunction.

Functions

func NewAndFunction

func NewAndFunction() provider.Function

NewAndFunction creates a new instance of the AndFunction with a complete function definition.

func NewCWDFunction

func NewCWDFunction(resolveWorkingDir WorkingDirResolver) provider.Function

NewCWDFunction creates a new instance of the CWDFunction with a complete function definition.

func NewComposeExecFunction

func NewComposeExecFunction() provider.Function

NewComposeExecFunction creates a new instance of the internal ComposeExecFunction that is used to execute functions that have been composed together.

func NewComposeFunction

func NewComposeFunction() provider.Function

NewComposeFunction creates a new instance of the ComposeFunction with a complete function definition.

func NewContainsFunction

func NewContainsFunction() provider.Function

NewContainsFunction creates a new instance of the ContainsFunction with a complete function definition.

func NewContains_G_Function

func NewContains_G_Function() provider.Function

NewContains_G_Function creates a new instance of the Contains_G_Function with a complete function definition.

func NewDateTimeFunction

func NewDateTimeFunction(clock core.Clock) provider.Function

NewDateTimeFunction creates a new instance of the DateTimeFunction with a complete function definition.

func NewEqFunction

func NewEqFunction() provider.Function

NewEqFunction creates a new instance of the EqFunction with a complete function definition.

func NewFilterFunction

func NewFilterFunction() provider.Function

NewFilterFunction creates a new instance of the FilterFunction with a complete function definition.

func NewFlatMapFunction

func NewFlatMapFunction() provider.Function

NewFlatMapFunction creates a new instance of the FlatMapFunction with a complete function definition.

func NewFromJSONFunction

func NewFromJSONFunction() provider.Function

NewFromJSONFunction creates a new instance of the FromJSONFunction with a complete function definition.

func NewFromJSON_G_Function

func NewFromJSON_G_Function() provider.Function

NewFromJSON_G_Function creates a new instance of the FromJSON_G_Function with a complete function definition.

func NewGeFunction

func NewGeFunction() provider.Function

NewGeFunction creates a new instance of the GeFunction with a complete function definition.

func NewGetAttrExecFunction

func NewGetAttrExecFunction() provider.Function

NewGetAttrExecFunction creates a new instance of the internal GetAttrExecFunction that is used to execute an attribute extraction function.

func NewGetAttrFunction

func NewGetAttrFunction() provider.Function

NewGetAttrFunction creates a new instance of the GetAttrFunction with a complete function definition.

func NewGetElemExecFunction

func NewGetElemExecFunction() provider.Function

NewGetElemExecFunction creates a new instance of the internal GetElemExecFunction that is used to execute an attribute extraction function.

func NewGetElemFunction

func NewGetElemFunction() provider.Function

NewGetElemFunction creates a new instance of the GetElemFunction with a complete function definition.

func NewGtFunction

func NewGtFunction() provider.Function

NewGtFunction creates a new instance of the GtFunction with a complete function definition.

func NewHasPrefixFunction

func NewHasPrefixFunction() provider.Function

NewHasPrefixFunction creates a new instance of the HasPrefixFunction with a complete function definition.

func NewHasPrefix_G_Function

func NewHasPrefix_G_Function() provider.Function

NewHasPrefix_G_Function creates a new instance of the HasPrefix_G_Function with a complete function definition.

func NewHasSuffixFunction

func NewHasSuffixFunction() provider.Function

NewHasSuffixFunction creates a new instance of the HasSuffixFunction with a complete function definition.

func NewHasSuffix_G_Function

func NewHasSuffix_G_Function() provider.Function

NewHasSuffix_G_Function creates a new instance of the HasSuffix_G_Function with a complete function definition.

func NewIndexFunction

func NewIndexFunction() provider.Function

NewIndexFunction creates a new instance of the IndexFunction with a complete function definition.

func NewJSONDecodeFunction

func NewJSONDecodeFunction() provider.Function

NewJSONDecodeFunction creates a new instance of the JSONDecodeFunction with a complete function definition.

func NewJoinFunction

func NewJoinFunction() provider.Function

NewJoinFunction creates a new instance of the JoinFunction with a complete function definition.

func NewKeysFunction

func NewKeysFunction() provider.Function

NewKeysFunction creates a new instance of the KeysFunction with a complete function definition.

func NewLastIndexFunction

func NewLastIndexFunction() provider.Function

NewLastIndexFunction creates a new instance of the LastIndexFunction with a complete function definition.

func NewLeFunction

func NewLeFunction() provider.Function

NewLeFunction creates a new instance of the LeFunction with a complete function definition.

func NewLenFunction

func NewLenFunction() provider.Function

NewLenFunction creates a new instance of the LenFunction with a complete function definition.

func NewLinkFunction

func NewLinkFunction(
	linkStateRetriever LinkStateRetriever,
	blueprintInstanceIDRetriever BlueprintInstanceIDRetriever,
) provider.Function

NewLinkFunction creates a new instance of the LinkFunction with a complete function definition. This function takes a state container for the current blueprint execution environment as a parameter to allow the link function to retrieve and return the state of a link between two resources. This also requires a function that resolves a blueprint instance ID for the current blueprint execution environment for the blueprint in which the link function is called.

func NewListFunction

func NewListFunction() provider.Function

NewListFunction creates a new instance of the ListFunction with a complete function definition.

func NewLtFunction

func NewLtFunction() provider.Function

NewLtFunction creates a new instance of the LtFunction with a complete function definition.

func NewMapFunction

func NewMapFunction() provider.Function

NewMapFunction creates a new instance of the MapFunction with a complete function definition.

func NewNotFunction

func NewNotFunction() provider.Function

NewNotFunction creates a new instance of the NotFunction with a complete function definition.

func NewObjectFunction

func NewObjectFunction() provider.Function

NewObjectFunction creates a new instance of the ObjectFunction with a complete function definition.

func NewOrFunction

func NewOrFunction() provider.Function

NewOrFunction creates a new instance of the OrFunction with a complete function definition.

func NewPipeExecFunction

func NewPipeExecFunction() provider.Function

NewPipeExecFunction creates a new instance of the internal PipeExecFunction that is used to execute functions that have been piped together.

func NewPipeFunction

func NewPipeFunction() provider.Function

NewPipeFunction creates a new instance of the PipeFunction with a complete function definition.

func NewReduceFunction

func NewReduceFunction() provider.Function

NewReduceFunction creates a new instance of the ReduceFunction with a complete function definition.

func NewReplaceFunction

func NewReplaceFunction() provider.Function

NewReplaceFunction creates a new instance of the ReplaceFunction with a complete function definition.

func NewReplace_G_Function

func NewReplace_G_Function() provider.Function

NewReplace_G_Function creates a new instance of the Replace_G_Function with a complete function definition.

func NewSortFunction

func NewSortFunction() provider.Function

NewSortFunction creates a new instance of the SortFunction with a complete function definition.

func NewSplitFunction

func NewSplitFunction() provider.Function

NewSplitFunction creates a new instance of the SplitFunction with a complete function definition.

func NewSplit_G_Function

func NewSplit_G_Function() provider.Function

NewSplit_G_Function creates a new instance of the Split_G_Function with a complete function definition.

func NewSubstrFunction

func NewSubstrFunction() provider.Function

NewSubstrFunction creates a new instance of the SubstrFunction with a complete function definition.

func NewSubstr_G_Function

func NewSubstr_G_Function() provider.Function

NewSubstr_G_Function creates a new instance of the Substr_G_Function with a complete function definition.

func NewToLowerFunction

func NewToLowerFunction() provider.Function

NewToLowerFunction creates a new instance of the NewToLowerFunction with a complete function definition.

func NewToUpperFunction

func NewToUpperFunction() provider.Function

NewToUpperFunction creates a new instance of the NewToUpperFunction with a complete function definition.

func NewTrimFunction

func NewTrimFunction() provider.Function

NewTrimFunction creates a new instance of the NewTrimFunction with a complete function definition.

func NewTrimPrefixFunction

func NewTrimPrefixFunction() provider.Function

NewTrimPrefixFunction creates a new instance of the TrimPrefixFunction with a complete function definition.

func NewTrimPrefix_G_Function

func NewTrimPrefix_G_Function() provider.Function

NewTrimPrefix_G_Function creates a new instance of the TrimPrefix_G_Function with a complete function definition.

func NewTrimSuffixFunction

func NewTrimSuffixFunction() provider.Function

NewTrimSuffixFunction creates a new instance of the TrimSuffixFunction with a complete function definition.

func NewTrimSuffix_G_Function

func NewTrimSuffix_G_Function() provider.Function

NewTrimSuffix_G_Function creates a new instance of the TrimSuffix_G_Function with a complete function definition.

func NewValsFunction

func NewValsFunction() provider.Function

NewValsFunction creates a new instance of the ValsFunction with a complete function definition.

Types

type AndFunction

type AndFunction struct {
	// contains filtered or unexported fields
}

AndFunction provides the implementation of a function that acts as a logical AND operator.

func (*AndFunction) Call

type BlueprintInstanceIDRetriever

type BlueprintInstanceIDRetriever func(ctx context.Context) (string, error)

BlueprintInstanceIDRetriever is a function that can be used to retrieve the instance ID for the current blueprint execution environment.

type CWDFunction

type CWDFunction struct {
	// contains filtered or unexported fields
}

CWDFunction provides the implementation of a function that gets the user's current working directory.

func (*CWDFunction) Call

type ComposeExecFunction

type ComposeExecFunction struct {
	// contains filtered or unexported fields
}

ComposeExecFunction provides the implementation of the internal function that executes a composed function. All higher-order functions require a named function that can be called at execution time. This should only be used for executing composed functions, and should only be directly referenced in the compose function implementation.

func (*ComposeExecFunction) Call

func (*ComposeExecFunction) GetDefinition

type ComposeFunction

type ComposeFunction struct {
	// contains filtered or unexported fields
}

ComposeFunction provides the implementation of the core "compose" function defined in the blueprint specification.

func (*ComposeFunction) Call

func (*ComposeFunction) GetDefinition

type ContainsFunction

type ContainsFunction struct {
	// contains filtered or unexported fields
}

ContainsFunction provides the implementation of a function that checks if a string has a suffix.

func (*ContainsFunction) Call

func (*ContainsFunction) GetDefinition

type Contains_G_Function

type Contains_G_Function struct {
	// contains filtered or unexported fields
}

Contains_G_Function provides the implementation of the core "contains_g" function defined in the blueprint specification.

func (*Contains_G_Function) Call

func (*Contains_G_Function) GetDefinition

type DateTimeFunction

type DateTimeFunction struct {
	// contains filtered or unexported fields
}

DateTimeFunction provides the implementation of a function that gets the current date/time as per the host system's clock in the specified format.

func (*DateTimeFunction) Call

func (*DateTimeFunction) GetDefinition

type EqFunction

type EqFunction struct {
	// contains filtered or unexported fields
}

EqFunction provides the implementation of a function that checks the equality of two values.

func (*EqFunction) Call

type FilterFunction

type FilterFunction struct {
	// contains filtered or unexported fields
}

FilterFunction provides the implementation of the core "filter" function defined in the blueprint specification.

func (*FilterFunction) Call

func (*FilterFunction) GetDefinition

type FlatMapFunction

type FlatMapFunction struct {
	// contains filtered or unexported fields
}

FlatMapFunction provides the implementation of the core "flatmap" function defined in the blueprint specification.

func (*FlatMapFunction) Call

func (*FlatMapFunction) GetDefinition

type FromJSONFunction

type FromJSONFunction struct {
	// contains filtered or unexported fields
}

FromJSONFunction provides the implementation of the core "fromjson" function defined in the blueprint specification.

func (*FromJSONFunction) Call

func (*FromJSONFunction) GetDefinition

type FromJSON_G_Function

type FromJSON_G_Function struct {
	// contains filtered or unexported fields
}

FromJSON_G_Function provides the implementation of the core "fromjson_g" function defined in the blueprint specification.

func (*FromJSON_G_Function) Call

func (*FromJSON_G_Function) GetDefinition

type GeFunction

type GeFunction struct {
	// contains filtered or unexported fields
}

GeFunction provides the implementation of a function that checks if a number is greater than or equal to another.

func (*GeFunction) Call

type GetAttrExecFunction

type GetAttrExecFunction struct {
	// contains filtered or unexported fields
}

GetAttrExecFunction provides the implementation of the internal function that executes a getattr function. All higher-order functions require a named function that can be called at execution time. This should only be used for executing the getattr function, and should only be directly referenced in the getattr function implementation.

func (*GetAttrExecFunction) Call

func (*GetAttrExecFunction) GetDefinition

type GetAttrFunction

type GetAttrFunction struct {
	// contains filtered or unexported fields
}

GetAttrFunction provides the implementation of the core "getattr" function defined in the blueprint specification.

func (*GetAttrFunction) Call

func (*GetAttrFunction) GetDefinition

type GetElemExecFunction

type GetElemExecFunction struct {
	// contains filtered or unexported fields
}

GetElemExecFunction provides the implementation of the internal function that executes a getelem function. All higher-order functions require a named function that can be called at execution time. This should only be used for executing the getelem function, and should only be directly referenced in the getelem function implementation.

func (*GetElemExecFunction) Call

func (*GetElemExecFunction) GetDefinition

type GetElemFunction

type GetElemFunction struct {
	// contains filtered or unexported fields
}

GetElemFunction provides the implementation of the core "getelem" function defined in the blueprint specification.

func (*GetElemFunction) Call

func (*GetElemFunction) GetDefinition

type GtFunction

type GtFunction struct {
	// contains filtered or unexported fields
}

GtFunction provides the implementation of a function that checks if a number is greater than another.

func (*GtFunction) Call

type HasPrefixFunction

type HasPrefixFunction struct {
	// contains filtered or unexported fields
}

HasPrefixFunction provides the implementation of a function that checks if a string has a prefix.

func (*HasPrefixFunction) Call

func (*HasPrefixFunction) GetDefinition

type HasPrefix_G_Function

type HasPrefix_G_Function struct {
	// contains filtered or unexported fields
}

HasPrefix_G_Function provides the implementation of the core "has_prefix_g" function defined in the blueprint specification.

func (*HasPrefix_G_Function) Call

func (*HasPrefix_G_Function) GetDefinition

type HasSuffixFunction

type HasSuffixFunction struct {
	// contains filtered or unexported fields
}

HasSuffixFunction provides the implementation of a function that checks if a string has a suffix.

func (*HasSuffixFunction) Call

func (*HasSuffixFunction) GetDefinition

type HasSuffix_G_Function

type HasSuffix_G_Function struct {
	// contains filtered or unexported fields
}

HasSuffix_G_Function provides the implementation of the core "has_suffix_g" function defined in the blueprint specification.

func (*HasSuffix_G_Function) Call

func (*HasSuffix_G_Function) GetDefinition

type IndexFunction

type IndexFunction struct {
	// contains filtered or unexported fields
}

IndexFunction provides the implementation of a function that joins an array of strings into a single string with a provided delimiter.

func (*IndexFunction) Call

type JSONDecodeFunction

type JSONDecodeFunction struct {
	// contains filtered or unexported fields
}

JSONDecodeFunction provides the implementation of a function that decodes a JSON string.

func (*JSONDecodeFunction) Call

func (*JSONDecodeFunction) GetDefinition

type JoinFunction

type JoinFunction struct {
	// contains filtered or unexported fields
}

JoinFunction provides the implementation of a function that joins an array of strings into a single string with a provided delimiter.

func (*JoinFunction) Call

type KeysFunction

type KeysFunction struct {
	// contains filtered or unexported fields
}

KeysFunction provides the implementation of a function that checks if a string has a suffix.

func (*KeysFunction) Call

type LastIndexFunction

type LastIndexFunction struct {
	// contains filtered or unexported fields
}

LastIndexFunction provides the implementation of a function that joins an array of strings into a single string with a provided delimiter.

func (*LastIndexFunction) Call

func (*LastIndexFunction) GetDefinition

type LeFunction

type LeFunction struct {
	// contains filtered or unexported fields
}

LeFunction provides the implementation of a function that checks if a number is greater than or equal to another.

func (*LeFunction) Call

type LenFunction

type LenFunction struct {
	// contains filtered or unexported fields
}

LenFunction provides the implementation of a function that gets the length of a string, array or mapping.

func (*LenFunction) Call

type LinkFunction

type LinkFunction struct {
	// contains filtered or unexported fields
}

LinkFunction provides the implementation of the core "link" function defined in the blueprint specification.

func (*LinkFunction) Call

type LinkStateRetriever

type LinkStateRetriever interface {
	// Get deals with retrieving the state for a given link
	// in the provided blueprint instance.
	GetByName(ctx context.Context, instanceID string, linkName string) (state.LinkState, error)
}

LinkStateRetriever is an interface that defines a service that can be used to retrieve the state of a link between two resources in a blueprint instance.

type ListFunction

type ListFunction struct {
	// contains filtered or unexported fields
}

ListFunction provides the implementation of a function that checks if a string has a suffix.

func (*ListFunction) Call

type LtFunction

type LtFunction struct {
	// contains filtered or unexported fields
}

LtFunction provides the implementation of a function that checks if a number is less than another.

func (*LtFunction) Call

type MapFunction

type MapFunction struct {
	// contains filtered or unexported fields
}

MapFunction provides the implementation of the core "map" function defined in the blueprint specification.

func (*MapFunction) Call

type NamedArgument

type NamedArgument struct {
	Name  string
	Value any
}

NamedArgument is a struct that represents a named argument. This must be passed into functions that expect named arguments such as the `object` function.

type NotFunction

type NotFunction struct {
	// contains filtered or unexported fields
}

NotFunction provides the implementation of a function that acts as a logical NOT operator.

func (*NotFunction) Call

type ObjectFunction

type ObjectFunction struct {
	// contains filtered or unexported fields
}

ObjectFunction provides the implementation of a function that checks if a string has a suffix.

func (*ObjectFunction) Call

func (*ObjectFunction) GetDefinition

type OrFunction

type OrFunction struct {
	// contains filtered or unexported fields
}

OrFunction provides the implementation of a function that acts as a logical OR operator.

func (*OrFunction) Call

type PipeExecFunction

type PipeExecFunction struct {
	// contains filtered or unexported fields
}

PipeExecFunction provides the implementation of the internal function that executes a piped function. All higher-order functions require a named function that can be called at execution time. This should only be used for executing piped functions, and should only be directly referenced in the pipe function implementation.

func (*PipeExecFunction) Call

func (*PipeExecFunction) GetDefinition

type PipeFunction

type PipeFunction struct {
	// contains filtered or unexported fields
}

PipeFunction provides the implementation of the core "pipe" function defined in the blueprint specification.

func (*PipeFunction) Call

type ReduceFunction

type ReduceFunction struct {
	// contains filtered or unexported fields
}

ReduceFunction provides the implementation of the core "reduce" function defined in the blueprint specification.

func (*ReduceFunction) Call

func (*ReduceFunction) GetDefinition

type ReplaceFunction

type ReplaceFunction struct {
	// contains filtered or unexported fields
}

ReplaceFunction provides the implementation of a function that replaces all occurrences of a substring in a string with another substring.

func (*ReplaceFunction) Call

func (*ReplaceFunction) GetDefinition

type Replace_G_Function

type Replace_G_Function struct {
	// contains filtered or unexported fields
}

Replace_G_Function provides the implementation of the core "replace_g" function defined in the blueprint specification.

func (*Replace_G_Function) Call

func (*Replace_G_Function) GetDefinition

type SortFunction

type SortFunction struct {
	// contains filtered or unexported fields
}

SortFunction provides the implementation of the core "sort" function defined in the blueprint specification. This uses an implementation of quicksort to sort the list of items, this won't be as efficient as Go's built-in sort package, but is a good alternative with support for error handling and being able to sort based on a custom comparison provider function.

func (*SortFunction) Call

type SplitFunction

type SplitFunction struct {
	// contains filtered or unexported fields
}

SplitFunction provides the implementation of a function that splits a string into an array of substrings based on a delimiter.

func (*SplitFunction) Call

type Split_G_Function

type Split_G_Function struct {
	// contains filtered or unexported fields
}

Split_G_Function provides the implementation of the core "split_g" function defined in the blueprint specification.

func (*Split_G_Function) Call

func (*Split_G_Function) GetDefinition

type SubstrFunction

type SubstrFunction struct {
	// contains filtered or unexported fields
}

SubstrFunction provides the implementation of a function that extracts a substring from a string.

func (*SubstrFunction) Call

func (*SubstrFunction) GetDefinition

type Substr_G_Function

type Substr_G_Function struct {
	// contains filtered or unexported fields
}

Substr_G_Function provides the implementation of the core "substr_g" function defined in the blueprint specification.

func (*Substr_G_Function) Call

func (*Substr_G_Function) GetDefinition

type ToLowerFunction

type ToLowerFunction struct {
	// contains filtered or unexported fields
}

ToLowerFunction provides the implementation of a function that converts a string to uppercase.

func (*ToLowerFunction) Call

func (*ToLowerFunction) GetDefinition

type ToUpperFunction

type ToUpperFunction struct {
	// contains filtered or unexported fields
}

ToUpperFunction provides the implementation of a function that converts a string to uppercase.

func (*ToUpperFunction) Call

func (*ToUpperFunction) GetDefinition

type TrimFunction

type TrimFunction struct {
	// contains filtered or unexported fields
}

TrimFunction provides the implementation of a function that trims leading and trailing whitespace from a string.

func (*TrimFunction) Call

type TrimPrefixFunction

type TrimPrefixFunction struct {
	// contains filtered or unexported fields
}

TrimPrefixFunction provides the implementation of a function that trims a prefix from a string.

func (*TrimPrefixFunction) Call

func (*TrimPrefixFunction) GetDefinition

type TrimPrefix_G_Function

type TrimPrefix_G_Function struct {
	// contains filtered or unexported fields
}

TrimPrefix_G_Function provides the implementation of the core "trimprefix_g" function defined in the blueprint specification.

func (*TrimPrefix_G_Function) Call

func (*TrimPrefix_G_Function) GetDefinition

type TrimSuffixFunction

type TrimSuffixFunction struct {
	// contains filtered or unexported fields
}

TrimSuffixFunction provides the implementation of a function that trims a prefix from a string.

func (*TrimSuffixFunction) Call

func (*TrimSuffixFunction) GetDefinition

type TrimSuffix_G_Function

type TrimSuffix_G_Function struct {
	// contains filtered or unexported fields
}

TrimSuffix_G_Function provides the implementation of the core "trimsuffix_g" function defined in the blueprint specification.

func (*TrimSuffix_G_Function) Call

func (*TrimSuffix_G_Function) GetDefinition

type ValsFunction

type ValsFunction struct {
	// contains filtered or unexported fields
}

ValsFunction provides the implementation of a function that checks if a string has a suffix.

func (*ValsFunction) Call

type WorkingDirResolver

type WorkingDirResolver func() (string, error)

WorkingDirResolver is a function that resolves the current working directory from a blueprint function execution context.

Jump to

Keyboard shortcuts

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