Documentation ¶
Index ¶
- Constants
- func BuildValidateFuncFloatAtLeastExclusive(min float64) string
- func BuildValidateFuncFloatAtMostExclusive(max float64) string
- type TerraformProperty
- func (tp TerraformProperty) IsComputed() bool
- func (tp TerraformProperty) IsOptional() bool
- func (tp TerraformProperty) IsRequired() bool
- func (tp *TerraformProperty) SetComputed(computed bool)
- func (tp *TerraformProperty) SetDescription(desc string)
- func (tp *TerraformProperty) SetOptional(optional bool)
- func (tp *TerraformProperty) SetRequired(required bool)
- func (tp *TerraformProperty) SetValidateFunc(validateFunc string)
- func (tp TerraformProperty) Validate() []string
- type TerraformSchema
- type TerraformScope
Constants ¶
const ( TypeString = "TypeString" TypeBool = "TypeBool" TypeInt = "TypeInt" TypeFloat = "TypeFloat" TypeList = "TypeList" TypeMap = "TypeMap" )
Constants for the primitive terraform types.
const ( ValidateFuncRFC3339Time = "validation.IsRFC3339Time" ValidateFuncIntAtLeast = "validation.IntAtLeast(%d)" ValidateFuncIntAtMost = "validation.IntAtMost(%d)" ValidateFuncFloatAtLeast = "validation.FloatAtLeast(%f)" ValidateFuncFloatAtMost = "validation.FloatAtMost(%f)" ValidateFuncFloatAtLeastExclusive = `` /* 251-byte string literal not displayed */ ValidateFuncFloatAtMostExclusive = `` /* 251-byte string literal not displayed */ )
Constants for Terraform SDKv2 validation functions.
const (
ValidateFuncMatchRegExPattern = "MatchRegExPattern"
)
Constants for Custom Validation Functions.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type TerraformProperty ¶
type TerraformProperty struct { Type string Required *bool Optional *bool Computed *bool Description *string ValidateFunc *string }
TerraformProperty represents a property of a Terraform Schema.
func NewTerraformProperty ¶
func NewTerraformProperty() *TerraformProperty
NewTerraformProperty creates a new TerraformProperty.
func (TerraformProperty) IsComputed ¶
func (tp TerraformProperty) IsComputed() bool
IsComputed returns true if the TerraformProperty is computed.
func (TerraformProperty) IsOptional ¶
func (tp TerraformProperty) IsOptional() bool
IsOptional returns true if the TerraformProperty is optional.
func (TerraformProperty) IsRequired ¶
func (tp TerraformProperty) IsRequired() bool
IsRequired returns true if the TerraformProperty is required.
func (*TerraformProperty) SetComputed ¶
func (tp *TerraformProperty) SetComputed(computed bool)
func (*TerraformProperty) SetDescription ¶
func (tp *TerraformProperty) SetDescription(desc string)
SetDescription sets the description of the TerraformProperty.
func (*TerraformProperty) SetOptional ¶
func (tp *TerraformProperty) SetOptional(optional bool)
func (*TerraformProperty) SetRequired ¶
func (tp *TerraformProperty) SetRequired(required bool)
func (*TerraformProperty) SetValidateFunc ¶
func (tp *TerraformProperty) SetValidateFunc(validateFunc string)
func (TerraformProperty) Validate ¶
func (tp TerraformProperty) Validate() []string
Validate validates the TerraformProperty.
type TerraformSchema ¶
type TerraformSchema struct { Scope *TerraformScope Name string NameCamelCase string NameSnakeCase string Properties map[string]TerraformProperty HasValidateFuncs bool }
Schema represents a Terraform Schema.
func NewTerrformSchema ¶
func NewTerrformSchema(name string, scope *TerraformScope) *TerraformSchema
NewTerrformSchema creates a new TerraformSchema.
func (*TerraformSchema) AddProp ¶
func (ts *TerraformSchema) AddProp(name string, prop *TerraformProperty)
func (TerraformSchema) Validate ¶
func (ts TerraformSchema) Validate() []string
Validate validates the TerraformSchema.
type TerraformScope ¶
type TerraformScope struct { Name string NameCamelCase string NameSnakeCase string Schemas []*TerraformSchema }
TerraformScope represents a collection of Terraform Schemas.
func NewTerrformScope ¶
func NewTerrformScope(name string) *TerraformScope
NewTerrformScope creates a new TerraformScope.
func (*TerraformScope) AddSchema ¶
func (ts *TerraformScope) AddSchema(schema *TerraformSchema)
AddSchema adds a TerraformSchema to the TerraformScope.