Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var EnvVariableRegexPattern = regexp.MustCompile(`{{ *\.Env\.([A-Za-z0-9_-]*) *}}`)
EnvVariableRegexPattern matching environment variable template reference of the format '{{ .Env.NAME_OF_VAR }}' accepting any possible whitespace before and after the actual variable, and capturing the name of the actual env var (anything following .Env. up to the first whitespace or } character)
var ListVariableRegexPattern = regexp.MustCompile(`"[\w\s]+"\s*:\s*(\[\s*\{\{\s*\.([\w]+)\s*}}\s*])`)
ListVariableRegexPattern matching list references in a Template, capturing the variable name as well as the enclosing square bracket block Sample format: "listKey": [ {{.list_variable}} ], captures: "[ {{.list_variable}} ]" and "list_variable"
Functions ¶
func IsEnvVariable ¶
IsEnvVariable checks if a given string conforms to how monaco expects an environment variable reference looks in a template ( '{{ .Env.NAME_OF_VAR }}' )
func IsListDefinition ¶
IsListDefinition checks if a given string conforms to a pattern of the format '"value", "value", ...' which are sometimes used to set lists into JSON templates
func IsSimpleValueDefinition ¶
IsSimpleValueDefinition checks if a given string is any text between double quotes
func MatchListVariable ¶
func TrimToEnvVariableName ¶
TrimToEnvVariableName takes an environment variable reference of the format '{{ .Env.NAME_OF_VAR }}' and trims it down to just the name of the environment variable ('NAME_OF_VAR'). If an input does not conform to the expected format of an environment variable, this will return the input back as is.
Types ¶
This section is empty.