Documentation
¶
Index ¶
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 GetScopedVarData(varData map[string]string) []*models.ScopedVariableData
Types ¶
type VariableParserRequest ¶
type VariableParserRequest struct { TemplateType VariableTemplateType Template string Variables []*models.ScopedVariableData IgnoreUnknownVariables bool }
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) ([]string, error) //ParseTemplate(template string, values map[string]string) string ParseTemplate(parserRequest VariableParserRequest) VariableParserResponse }
type VariableTemplateParserImpl ¶
type VariableTemplateParserImpl struct {
// contains filtered or unexported fields
}
func NewVariableTemplateParserImpl ¶
func NewVariableTemplateParserImpl(logger *zap.SugaredLogger) *VariableTemplateParserImpl
func (*VariableTemplateParserImpl) ExtractVariables ¶
func (impl *VariableTemplateParserImpl) ExtractVariables(template string) ([]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.