tf

package
v0.0.0-...-bcf26a6 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

README

Terraform SDKv2

This package contains code relevant for Terraform SDKv2.

Documentation

Index

Constants

View Source
const (
	TypeString = "TypeString"
	TypeBool   = "TypeBool"
	TypeInt    = "TypeInt"
	TypeFloat  = "TypeFloat"
	TypeList   = "TypeList"
	TypeMap    = "TypeMap"
)

Constants for the primitive terraform types.

View Source
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.

View Source
const (
	ValidateFuncMatchRegExPattern = "MatchRegExPattern"
)

Constants for Custom Validation Functions.

Variables

This section is empty.

Functions

func BuildValidateFuncFloatAtLeastExclusive

func BuildValidateFuncFloatAtLeastExclusive(min float64) string

func BuildValidateFuncFloatAtMostExclusive

func BuildValidateFuncFloatAtMostExclusive(max float64) string

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.

Jump to

Keyboard shortcuts

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