hot

package
v0.22.6 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConstraintNativeArgumentIndexes = map[string][]int{}
View Source
var ConstraintScriptlets = map[string]string{
	parsing.MetadataContraintPrefix + "length":            profiles.GetString(constraintPathPrefix + "length.js"),
	parsing.MetadataContraintPrefix + "range":             profiles.GetString(constraintPathPrefix + "range.js"),
	parsing.MetadataContraintPrefix + "modulo":            profiles.GetString(constraintPathPrefix + "modulo.js"),
	parsing.MetadataContraintPrefix + "allowed_values":    profiles.GetString(constraintPathPrefix + "allowed_values.js"),
	parsing.MetadataContraintPrefix + "allowed_pattern":   profiles.GetString(constraintPathPrefix + "allowed_pattern.js"),
	parsing.MetadataContraintPrefix + "custom_constraint": profiles.GetString(constraintPathPrefix + "custom_constraint.js"),
}

Built-in constraint functions

View Source
var DefaultScriptletNamespace = parsing.NewScriptletNamespace()
View Source
var DeletionPolicies = map[string]string{
	"Delete":   "Delete",
	"Retain":   "Retain",
	"Snapshot": "Snapshot",
	"delete":   "Delete",
	"retain":   "Retain",
	"snapshot": "Snapshot",
}
View Source
var FunctionScriptlets = map[string]string{
	parsing.MetadataFunctionPrefix + "and":                 profiles.GetString(functionPathPrefix + "and.js"),
	parsing.MetadataFunctionPrefix + "contains":            profiles.GetString(functionPathPrefix + "contains.js"),
	parsing.MetadataFunctionPrefix + "digest":              profiles.GetString(functionPathPrefix + "digest.js"),
	parsing.MetadataFunctionPrefix + "equals":              profiles.GetString(functionPathPrefix + "equals.js"),
	parsing.MetadataFunctionPrefix + "filter":              profiles.GetString(functionPathPrefix + "filter.js"),
	parsing.MetadataFunctionPrefix + "get_attr":            profiles.GetString(functionPathPrefix + "get_attr.js"),
	parsing.MetadataFunctionPrefix + "get_file":            profiles.GetString(functionPathPrefix + "get_file.js"),
	parsing.MetadataFunctionPrefix + "get_param":           profiles.GetString(functionPathPrefix + "get_param.js"),
	parsing.MetadataFunctionPrefix + "get_resource":        profiles.GetString(functionPathPrefix + "get_resource.js"),
	parsing.MetadataFunctionPrefix + "if":                  profiles.GetString(functionPathPrefix + "if.js"),
	parsing.MetadataFunctionPrefix + "list_concat_unique":  profiles.GetString(functionPathPrefix + "list_concat_unique.js"),
	parsing.MetadataFunctionPrefix + "list_concat":         profiles.GetString(functionPathPrefix + "list_concat.js"),
	parsing.MetadataFunctionPrefix + "list_join":           profiles.GetString(functionPathPrefix + "list_join.js"),
	parsing.MetadataFunctionPrefix + "make_url":            profiles.GetString(functionPathPrefix + "make_url.js"),
	parsing.MetadataFunctionPrefix + "map_merge":           profiles.GetString(functionPathPrefix + "map_merge.js"),
	parsing.MetadataFunctionPrefix + "map_replace":         profiles.GetString(functionPathPrefix + "map_replace.js"),
	parsing.MetadataFunctionPrefix + "not":                 profiles.GetString(functionPathPrefix + "not.js"),
	parsing.MetadataFunctionPrefix + "or":                  profiles.GetString(functionPathPrefix + "or.js"),
	parsing.MetadataFunctionPrefix + "repeat":              profiles.GetString(functionPathPrefix + "repeat.js"),
	parsing.MetadataFunctionPrefix + "resource_facade":     profiles.GetString(functionPathPrefix + "resource_facade.js"),
	parsing.MetadataFunctionPrefix + "str_replace_strict":  profiles.GetString(functionPathPrefix + "str_replace_strict.js"),
	parsing.MetadataFunctionPrefix + "str_replace_vstrict": profiles.GetString(functionPathPrefix + "str_replace_vstrict.js"),
	parsing.MetadataFunctionPrefix + "str_replace":         profiles.GetString(functionPathPrefix + "str_replace.js"),
	parsing.MetadataFunctionPrefix + "str_split":           profiles.GetString(functionPathPrefix + "str_split.js"),
	parsing.MetadataFunctionPrefix + "yaql":                profiles.GetString(functionPathPrefix + "yaql.js"),
}
View Source
var Grammar = parsing.NewGrammar()
View Source
var ParameterTypes = []string{
	"boolean",
	"comma_delimited_list",
	"json",
	"number",
	"string",
}
View Source
var ResourceTypes = map[string]string{}/* 136 elements not displayed */

Functions

func GetDeletionPolicy

func GetDeletionPolicy(policy string) (string, bool)

func IsParameterTypeValid

func IsParameterTypeValid(type_ string) bool

func NormalizeFunctionCallArguments

func NormalizeFunctionCallArguments(functionCall *parsing.FunctionCall, context *parsing.Context)

func ParseFunctionCall added in v0.21.0

func ParseFunctionCall(context *parsing.Context) bool

func ParseFunctionCalls added in v0.21.0

func ParseFunctionCalls(context *parsing.Context) bool

func ReadCondition

func ReadCondition(context *parsing.Context) parsing.EntityPtr

(parsing.Reader signature)

func ReadConditionDefinition

func ReadConditionDefinition(context *parsing.Context) parsing.EntityPtr

(parsing.Reader signature)

func ReadConstraint

func ReadConstraint(context *parsing.Context) parsing.EntityPtr

(parsing.Reader signature)

func ReadData

func ReadData(context *parsing.Context) parsing.EntityPtr

(parsing.Reader signature)

func ReadOutput

func ReadOutput(context *parsing.Context) parsing.EntityPtr

(parsing.Reader signature)

func ReadParameter

func ReadParameter(context *parsing.Context) parsing.EntityPtr

(parsing.Reader signature)

func ReadParameterGroup

func ReadParameterGroup(context *parsing.Context) parsing.EntityPtr

(parsing.Reader signature)

func ReadResource

func ReadResource(context *parsing.Context) parsing.EntityPtr

(parsing.Reader signature)

func ReadTemplate

func ReadTemplate(context *parsing.Context) parsing.EntityPtr

(parsing.Reader signature)

func ReadValue

func ReadValue(context *parsing.Context) parsing.EntityPtr

(parsing.Reader signature)

Types

type Condition

type Condition struct {
	*Entity `name:"condition"`

	Operator              string
	Arguments             ard.List
	NativeArgumentIndexes []int

	DefinitionName *string

	Value *bool
}

func NewCondition

func NewCondition(context *parsing.Context) *Condition

type ConditionDefinition

type ConditionDefinition struct {
	*Entity `name:"condition definition"`
	Name    string `namespace:""`

	Operator              string
	Arguments             ard.List
	NativeArgumentIndexes []int
}

func NewConditionDefinition

func NewConditionDefinition(context *parsing.Context) *ConditionDefinition

type ConditionDefinitions

type ConditionDefinitions []*ConditionDefinition

type Constraint

type Constraint struct {
	*Entity `name:"constraint"`

	Description *string
	Operator    string
	Arguments   ard.List
}

func NewConstraint

func NewConstraint(context *parsing.Context) *Constraint

func (*Constraint) NewFunctionCall

func (self *Constraint) NewFunctionCall(context *parsing.Context) *parsing.FunctionCall

type Constraints

type Constraints []*Constraint

func (Constraints) Normalize

func (self Constraints) Normalize(context *parsing.Context, normalDataType *normal.ValueMeta)

type Data

type Data struct {
	*Entity `name:"data"`

	Data ard.Value
}

func NewData

func NewData(context *parsing.Context) *Data

type Entity

type Entity struct {
	Context *parsing.Context `traverse:"ignore" json:"-" yaml:"-"`
	// contains filtered or unexported fields
}

func NewEntity

func NewEntity(context *parsing.Context) *Entity

func (*Entity) GetContext

func (self *Entity) GetContext() *parsing.Context

(parsing.Contextual interface)

type Output

type Output struct {
	*Entity `name:"output"`
	Name    string `namespace:""`

	Description *string    `read:"description"`
	Value       *Value     `read:"value,Value" mandatory:""`
	Condition   *Condition `read:"condition,Condition"`
}

func NewOutput

func NewOutput(context *parsing.Context) *Output

func (*Output) GetKey

func (self *Output) GetKey() string

(parsing.Mappable interface)

func (*Output) Normalize

func (self *Output) Normalize(context *parsing.Context) normal.Value

type Outputs

type Outputs map[string]*Output

func (Outputs) Normalize

func (self Outputs) Normalize(normalConstrainables normal.Values, context *parsing.Context)

type Parameter

type Parameter struct {
	*Entity `name:"parameter"`
	Name    string `namespace:""`

	Type        *string     `read:"type" mandatory:""`
	Label       *string     `read:"label"`
	Description *string     `read:"description"`
	Default     *Value      `read:"default,Value"`
	Hidden      *bool       `read:"hidden"`
	Constraints Constraints `read:"constraints,[]Constraint"`
	Immutable   *bool       `read:"immutable"`
	Tags        *[]string   `read:"tags"`

	Value *Value
}

func NewParameter

func NewParameter(context *parsing.Context) *Parameter

func (*Parameter) GetKey

func (self *Parameter) GetKey() string

(parsing.Mappable interface)

func (*Parameter) Normalize

func (self *Parameter) Normalize(context *parsing.Context) normal.Value

func (*Parameter) Render

func (self *Parameter) Render()

(parsing.Renderable interface)

type ParameterGroup

type ParameterGroup struct {
	*Entity `name:"parameter group"`

	Label       *string   `read:"label"`
	Description *string   `read:"description"`
	Parameters  []*string `read:"parameters"`
}

func NewParameterGroup

func NewParameterGroup(context *parsing.Context) *ParameterGroup

type ParameterGroups

type ParameterGroups []*ParameterGroup

type Parameters

type Parameters map[string]*Parameter

func (Parameters) Normalize

func (self Parameters) Normalize(c normal.Values, context *parsing.Context)

type Resource

type Resource struct {
	*Entity `name:"resource"`
	Name    string `namespace:""`

	Type           *string    `read:"type" mandatory:""`
	Properties     Values     `read:"properties,Value"`
	Metadata       *Data      `read:"metadata,Data"`
	DependsOn      *[]string  `read:"depends_on"`
	UpdatePolicy   *Data      `read:"update_policy,Data"`
	DeletionPolicy *string    `read:"deletion_policy"`
	ExternalID     *string    `read:"external_id"`
	Condition      *Condition `read:"condition,Condition"`

	ToscaType          *string   `json:"-" yaml:"-"`
	DependsOnResources Resources `lookup:"depends_on,DependsOn" traverse:"ignore" json:"-" yaml:"-"`
}

func NewResource

func NewResource(context *parsing.Context) *Resource

func (*Resource) Normalize

func (self *Resource) Normalize(normalServiceTemplate *normal.ServiceTemplate) *normal.NodeTemplate

func (*Resource) NormalizeDependencies

func (self *Resource) NormalizeDependencies(normalServiceTemplate *normal.ServiceTemplate)

type Resources

type Resources []*Resource

func (Resources) Normalize

func (self Resources) Normalize(normalServiceTemplate *normal.ServiceTemplate)

type Template

type Template struct {
	*Entity `name:"template"`

	HeatTemplateVersion  *string
	Description          *string              `read:"description"`
	ParameterGroups      ParameterGroups      `read:"parameter_groups,[]ParameterGroup"`
	Parameters           Parameters           `read:"parameters,Parameter"`
	Resources            Resources            `read:"resources,Resource"`
	Outputs              Outputs              `read:"outputs,Output"`
	ConditionDefinitions ConditionDefinitions `read:"conditions,ConditionDefinition"`
}

func NewTemplate

func NewTemplate(context *parsing.Context) *Template

func (*Template) GetImportSpecs

func (self *Template) GetImportSpecs() []*parsing.ImportSpec

(parsing.Importer interface)

func (*Template) NewPseudoParameter

func (self *Template) NewPseudoParameter(name string, value string)

func (*Template) NormalizeServiceTemplate

func (self *Template) NormalizeServiceTemplate() *normal.ServiceTemplate

normal.Normalizable interface

func (*Template) SetInputs

func (self *Template) SetInputs(inputs map[string]ard.Value)

parsing.HasInputs interface

type Value

type Value struct {
	*Entity `name:"value"`
	Name    string

	Constraints Constraints

	Meta *normal.ValueMeta `traverse:"ignore" json:"-" yaml:"-"`
}

func NewValue

func NewValue(context *parsing.Context) *Value

func (*Value) CoerceParameterType

func (self *Value) CoerceParameterType(type_ string)

func (*Value) GetKey

func (self *Value) GetKey() string

(parsing.Mappable interface)

func (*Value) Normalize

func (self *Value) Normalize() normal.Value

func (*Value) ValidateParameterType

func (self *Value) ValidateParameterType(type_ string) bool

type Values

type Values map[string]*Value

func (Values) Normalize

func (self Values) Normalize(normalConstrainables normal.Values)

Jump to

Keyboard shortcuts

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