construct

package
v0.2.0-alpha Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2024 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DebugPrintStruct

func DebugPrintStruct(ctx context.Context, prefix string, v interface{})

func ParseEnum

func ParseEnum[T any](value basetypes.StringValue, parser func(string) (any, error), setter func(T)) error

ParseEnum parses an enum value and sets it if the value is not null or unknown. It accepts a basetypes.StringValue (Terraform SDK type) and uses a parser function to translate the string into an enum type. If the value is valid, it casts the parsed value to the expected type T and passes it to the setter function.

func SetArrayProperty

func SetArrayProperty(values []types.String, setter func([]string))

Add this new helper function to your construct package

func SetBoolProperty

func SetBoolProperty(value basetypes.BoolValue, setter func(*bool))

SetBoolProperty sets the value of a bool property if the value is not null or unknown. It accepts a basetypes.BoolValue (Terraform SDK type) and translates it into a pointer to a bool for use in the setter function.

func SetInt32Property

func SetInt32Property(value basetypes.Int32Value, setter func(*int32))

SetInt32Property sets the value of an int32 property if the value is not null or unknown. It accepts a basetypes.Int32Value (Terraform SDK type) and passes it to the setter function.

func SetInt64Property

func SetInt64Property(value basetypes.Int64Value, setter func(*int64))

SetInt64Property sets the value of an int64 property if the value is not null or unknown. It accepts a basetypes.Int64Value (Terraform SDK type) and passes it to the setter function.

func SetStringProperty

func SetStringProperty(value basetypes.StringValue, setter func(*string))

SetStringProperty sets the value of a string property if the value is not null or unknown. It accepts a basetypes.StringValue (Terraform SDK type) and translates it into a pointer to a string for use in the setter function.

Types

This section is empty.

Jump to

Keyboard shortcuts

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