Documentation ¶
Index ¶
- func SchemaOfType(typ any, name string, def any, description string, sensitive bool, order int) (schema openapi3.Schema)
- func ToGoTypeValues(values map[string]json.RawMessage, schema openapi3.Schema) (r map[string]any, err error)
- type TerraformTranslator
- func (t TerraformTranslator) GetOriginalType(schema *openapi3.Schema) cty.Type
- func (t TerraformTranslator) SchemaMatched(schema openapi3.Schema) bool
- func (t TerraformTranslator) SchemaOfOriginalType(tp any, name string, def any, description string, sensitive bool, order int) *openapi3.Schema
- func (t TerraformTranslator) ToGoTypeValues(values map[string]json.RawMessage, schema openapi3.Schema) (map[string]any, error)
- func (t TerraformTranslator) ToOriginalTypeValues(values map[string]any) ([]string, map[string]cty.Value, error)
- type Translator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SchemaOfType ¶
func SchemaOfType( typ any, name string, def any, description string, sensitive bool, order int, ) (schema openapi3.Schema)
SchemaOfType generates openAPI schema from original type.
func ToGoTypeValues ¶
func ToGoTypeValues(values map[string]json.RawMessage, schema openapi3.Schema) (r map[string]any, err error)
ToGoTypeValues converts values to go types.
Types ¶
type TerraformTranslator ¶
type TerraformTranslator struct{}
TerraformTranslator translates between terraform types and go types with openapi schema.
func NewTerraformTranslator ¶
func NewTerraformTranslator() TerraformTranslator
NewTerraformTranslator creates a new terraform translator.
func (TerraformTranslator) GetOriginalType ¶
func (t TerraformTranslator) GetOriginalType(schema *openapi3.Schema) cty.Type
GetOriginalType returns the original type of the schema.
func (TerraformTranslator) SchemaMatched ¶
func (t TerraformTranslator) SchemaMatched(schema openapi3.Schema) bool
func (TerraformTranslator) SchemaOfOriginalType ¶
func (t TerraformTranslator) SchemaOfOriginalType( tp any, name string, def any, description string, sensitive bool, order int, ) *openapi3.Schema
SchemaOfOriginalType generates openAPI schema from terraform type.
func (TerraformTranslator) ToGoTypeValues ¶
func (t TerraformTranslator) ToGoTypeValues( values map[string]json.RawMessage, schema openapi3.Schema, ) (map[string]any, error)
ToGoTypeValues converts the values to go types.
func (TerraformTranslator) ToOriginalTypeValues ¶
func (t TerraformTranslator) ToOriginalTypeValues(values map[string]any) ([]string, map[string]cty.Value, error)
ToOriginalTypeValues Converts arbitrary go types to a cty Value.
type Translator ¶
type Translator interface { // SchemaOfOriginalType generates openAPI schema from original type. SchemaOfOriginalType( typ any, name string, def any, description string, sensitive bool, order int) *openapi3.Schema // ToGoTypeValues converts values to go types. ToGoTypeValues(values map[string]json.RawMessage, schema openapi3.Schema) (map[string]any, error) }
Translator translates between original template language and go types with openapi schema.
Click to show internal directories.
Click to hide internal directories.