Documentation ¶
Index ¶
- Constants
- Variables
- func GetScopedVarData(varData map[string]string, nameToIsSensitive map[string]bool, ...) []*models.ScopedVariableData
- func GetVariableMapForUsedVariables(scopedVariables []*models.ScopedVariableData, usedVars []string) map[string]string
- type VariableParserRequest
- type VariableParserResponse
- type VariableTemplateParser
- type VariableTemplateParserConfig
- type VariableTemplateParserImpl
- type VariableTemplateType
Constants ¶
View Source
const DefaultVariableTemplate = JsonVariableTemplate
View Source
const InvalidTemplate = "invalid-template"
View Source
const UnknownVariableErrorMsg = "unknown variables found, %s"
View Source
const UnknownVariableFound = "unknown-variable-found"
View Source
const VariableParsingFailed = "variable-parsing-failed"
Variables ¶
View Source
var ParseBoolFunc = function.New(&function.Spec{ Description: `convert to bool value`, Params: []function.Parameter{ { Name: "val", Type: cty.String, AllowDynamicType: true, AllowMarked: true, }, }, Type: function.StaticReturnType(cty.Bool), RefineResult: refineNonNull, Impl: func(args []cty.Value, retType cty.Type) (cty.Value, error) { boolVal, err := strconv.ParseBool(args[0].AsString()) return cty.BoolVal(boolVal), err }, })
Functions ¶
func GetScopedVarData ¶
func GetVariableMapForUsedVariables ¶ added in v0.6.26
func GetVariableMapForUsedVariables(scopedVariables []*models.ScopedVariableData, usedVars []string) map[string]string
Types ¶
type VariableParserRequest ¶
type VariableParserRequest struct { TemplateType VariableTemplateType Template string Variables []*models.ScopedVariableData IgnoreUnknownVariables bool }
func CreateParserRequest ¶ added in v0.6.26
func CreateParserRequest(template string, templateType VariableTemplateType, variables []*models.ScopedVariableData, ignoreUnknownVariables bool) VariableParserRequest
func (VariableParserRequest) GetEmptyResponse ¶ added in v0.6.25
func (request VariableParserRequest) GetEmptyResponse() VariableParserResponse
func (VariableParserRequest) GetOriginalValuesMap ¶ added in v0.6.25
func (request VariableParserRequest) GetOriginalValuesMap() map[string]interface{}
func (VariableParserRequest) GetValuesMap ¶
func (request VariableParserRequest) GetValuesMap() map[string]string
type VariableParserResponse ¶
type VariableParserResponse struct { Request VariableParserRequest ResolvedTemplate string Error error DetailedError string }
type VariableTemplateParser ¶
type VariableTemplateParser interface { ExtractVariables(template string, templateType VariableTemplateType) ([]string, error) //ParseTemplate(template string, values map[string]string) string ParseTemplate(parserRequest VariableParserRequest) VariableParserResponse }
type VariableTemplateParserConfig ¶ added in v0.6.24
type VariableTemplateParserConfig struct { ScopedVariableEnabled bool `env:"SCOPED_VARIABLE_ENABLED" envDefault:"false"` ScopedVariableHandlePrimitives bool `env:"SCOPED_VARIABLE_HANDLE_PRIMITIVES" envDefault:"false"` VariableExpressionRegex string `env:"VARIABLE_EXPRESSION_REGEX" envDefault:"@{{([^}]+)}}"` }
type VariableTemplateParserImpl ¶
type VariableTemplateParserImpl struct {
// contains filtered or unexported fields
}
func NewVariableTemplateParserImpl ¶
func NewVariableTemplateParserImpl(logger *zap.SugaredLogger) (*VariableTemplateParserImpl, error)
func (*VariableTemplateParserImpl) ExtractVariables ¶
func (impl *VariableTemplateParserImpl) ExtractVariables(template string, templateType VariableTemplateType) ([]string, error)
func (*VariableTemplateParserImpl) ParseTemplate ¶
func (impl *VariableTemplateParserImpl) ParseTemplate(parserRequest VariableParserRequest) VariableParserResponse
type VariableTemplateType ¶
type VariableTemplateType int
const ( StringVariableTemplate VariableTemplateType = 0 JsonVariableTemplate = 1 )
Click to show internal directories.
Click to hide internal directories.