Documentation ¶
Index ¶
- Constants
- Variables
- func AttributeTypes[T any](ctx context.Context) (map[string]attr.Type, error)
- func AttributeTypesMust[T any](ctx context.Context) map[string]attr.Type
- type ARN
- func (a ARN) Equal(other attr.Value) bool
- func (a ARN) IsNull() bool
- func (a ARN) IsUnknown() bool
- func (a ARN) String() string
- func (a ARN) ToStringValue(ctx context.Context) (types.String, diag.Diagnostics)
- func (a ARN) ToTerraformValue(ctx context.Context) (tftypes.Value, error)
- func (a ARN) Type(_ context.Context) attr.Type
- func (a ARN) ValueARN() arn.ARN
- type CIDRBlock
- func (c CIDRBlock) Equal(other attr.Value) bool
- func (c CIDRBlock) IsNull() bool
- func (c CIDRBlock) IsUnknown() bool
- func (c CIDRBlock) String() string
- func (c CIDRBlock) ToStringValue(ctx context.Context) (types.String, diag.Diagnostics)
- func (c CIDRBlock) ToTerraformValue(ctx context.Context) (tftypes.Value, error)
- func (c CIDRBlock) Type(_ context.Context) attr.Type
- func (c CIDRBlock) ValueCIDRBlock() string
- type Duration
- func (d Duration) Equal(other attr.Value) bool
- func (d Duration) IsNull() bool
- func (d Duration) IsUnknown() bool
- func (d Duration) String() string
- func (d Duration) ToStringValue(ctx context.Context) (types.String, diag.Diagnostics)
- func (d Duration) ToTerraformValue(ctx context.Context) (tftypes.Value, error)
- func (d Duration) Type(_ context.Context) attr.Type
- func (d Duration) ValueDuration() time.Duration
- type ListNestedObjectTypeOf
- func (t ListNestedObjectTypeOf[T]) Equal(o attr.Type) bool
- func (t ListNestedObjectTypeOf[T]) NewObjectPtr(ctx context.Context) (any, diag.Diagnostics)
- func (t ListNestedObjectTypeOf[T]) NewObjectSlice(ctx context.Context, len, cap int) (any, diag.Diagnostics)
- func (t ListNestedObjectTypeOf[T]) NullValue(ctx context.Context) (attr.Value, diag.Diagnostics)
- func (t ListNestedObjectTypeOf[T]) String() string
- func (t ListNestedObjectTypeOf[T]) ValueFromList(ctx context.Context, in basetypes.ListValue) (basetypes.ListValuable, diag.Diagnostics)
- func (t ListNestedObjectTypeOf[T]) ValueFromObjectPtr(ctx context.Context, ptr any) (attr.Value, diag.Diagnostics)
- func (t ListNestedObjectTypeOf[T]) ValueFromObjectSlice(ctx context.Context, slice any) (attr.Value, diag.Diagnostics)
- func (t ListNestedObjectTypeOf[T]) ValueFromTerraform(ctx context.Context, in tftypes.Value) (attr.Value, error)
- func (t ListNestedObjectTypeOf[T]) ValueType(ctx context.Context) attr.Value
- type ListNestedObjectValueOf
- func NewListNestedObjectValueOfNull[T any](ctx context.Context) ListNestedObjectValueOf[T]
- func NewListNestedObjectValueOfPtr[T any](ctx context.Context, t *T) ListNestedObjectValueOf[T]
- func NewListNestedObjectValueOfSlice[T any](ctx context.Context, ts []*T) ListNestedObjectValueOf[T]
- func NewListNestedObjectValueOfUnknown[T any](ctx context.Context) ListNestedObjectValueOf[T]
- func NewListNestedObjectValueOfValueSlice[T any](ctx context.Context, ts []T) ListNestedObjectValueOf[T]
- func (v ListNestedObjectValueOf[T]) Equal(o attr.Value) bool
- func (v ListNestedObjectValueOf[T]) ToObjectPtr(ctx context.Context) (any, diag.Diagnostics)
- func (v ListNestedObjectValueOf[T]) ToObjectSlice(ctx context.Context) (any, diag.Diagnostics)
- func (v ListNestedObjectValueOf[T]) Type(ctx context.Context) attr.Type
- type NestedObjectType
- type NestedObjectValue
- type ObjectTypeOf
- func (t ObjectTypeOf[T]) Equal(o attr.Type) bool
- func (t ObjectTypeOf[T]) String() string
- func (t ObjectTypeOf[T]) ValueFromObject(ctx context.Context, in basetypes.ObjectValue) (basetypes.ObjectValuable, diag.Diagnostics)
- func (t ObjectTypeOf[T]) ValueFromTerraform(ctx context.Context, in tftypes.Value) (attr.Value, error)
- func (t ObjectTypeOf[T]) ValueType(ctx context.Context) attr.Value
- type ObjectValueOf
- type Regexp
- func (a Regexp) Equal(other attr.Value) bool
- func (a Regexp) IsNull() bool
- func (a Regexp) IsUnknown() bool
- func (a Regexp) String() string
- func (a Regexp) ToStringValue(ctx context.Context) (types.String, diag.Diagnostics)
- func (a Regexp) ToTerraformValue(ctx context.Context) (tftypes.Value, error)
- func (a Regexp) Type(_ context.Context) attr.Type
- func (a Regexp) ValueRegexp() *regexp.Regexp
- type SetNestedObjectTypeOf
- func (t SetNestedObjectTypeOf[T]) Equal(o attr.Type) bool
- func (t SetNestedObjectTypeOf[T]) NewObjectPtr(ctx context.Context) (any, diag.Diagnostics)
- func (t SetNestedObjectTypeOf[T]) NewObjectSlice(ctx context.Context, len, cap int) (any, diag.Diagnostics)
- func (t SetNestedObjectTypeOf[T]) NullValue(ctx context.Context) (attr.Value, diag.Diagnostics)
- func (t SetNestedObjectTypeOf[T]) String() string
- func (t SetNestedObjectTypeOf[T]) ValueFromObjectPtr(ctx context.Context, ptr any) (attr.Value, diag.Diagnostics)
- func (t SetNestedObjectTypeOf[T]) ValueFromObjectSlice(ctx context.Context, slice any) (attr.Value, diag.Diagnostics)
- func (t SetNestedObjectTypeOf[T]) ValueFromSet(ctx context.Context, in basetypes.SetValue) (basetypes.SetValuable, diag.Diagnostics)
- func (t SetNestedObjectTypeOf[T]) ValueFromTerraform(ctx context.Context, in tftypes.Value) (attr.Value, error)
- func (t SetNestedObjectTypeOf[T]) ValueType(ctx context.Context) attr.Value
- type SetNestedObjectValueOf
- func NewSetNestedObjectValueOfNull[T any](ctx context.Context) SetNestedObjectValueOf[T]
- func NewSetNestedObjectValueOfPtr[T any](ctx context.Context, t *T) SetNestedObjectValueOf[T]
- func NewSetNestedObjectValueOfSlice[T any](ctx context.Context, ts []*T) SetNestedObjectValueOf[T]
- func NewSetNestedObjectValueOfUnknown[T any](ctx context.Context) SetNestedObjectValueOf[T]
- func NewSetNestedObjectValueOfValueSlice[T any](ctx context.Context, ts []T) SetNestedObjectValueOf[T]
- func (v SetNestedObjectValueOf[T]) Equal(o attr.Value) bool
- func (v SetNestedObjectValueOf[T]) ToObjectPtr(ctx context.Context) (any, diag.Diagnostics)
- func (v SetNestedObjectValueOf[T]) ToObjectSlice(ctx context.Context) (any, diag.Diagnostics)
- func (v SetNestedObjectValueOf[T]) Type(ctx context.Context) attr.Type
- type TimestampType
- func (typ TimestampType) Equal(o attr.Type) bool
- func (typ TimestampType) String() string
- func (typ TimestampType) Validate(ctx context.Context, in tftypes.Value, path path.Path) diag.Diagnostics
- func (typ TimestampType) ValueFromString(_ context.Context, in basetypes.StringValue) (basetypes.StringValuable, diag.Diagnostics)
- func (typ TimestampType) ValueFromTerraform(_ context.Context, in tftypes.Value) (attr.Value, error)
- func (typ TimestampType) ValueType(context.Context) attr.Value
- type TimestampValue
Constants ¶
const (
ARNType arnType = iota
)
const (
CIDRBlockType cidrBlockType = iota
)
const (
DurationType durationType = iota
)
Variables ¶
var (
RegexpType = regexpType{}
)
Functions ¶
func AttributeTypes ¶
AttributeTypes returns a map of attribute types for the specified type T. T must be a struct and reflection is used to find exported fields of T with the `tfsdk` tag.
Types ¶
type ARN ¶
type ARN struct {
// contains filtered or unexported fields
}
func ARNUnknown ¶
func ARNUnknown() ARN
func (ARN) String ¶
String returns a summary representation of either the underlying Value, or UnknownValueString (`<unknown>`) when IsUnknown() returns true, or NullValueString (`<null>`) when IsNull() return true.
This is an intentionally lossy representation, that are best suited for logging and error reporting, as they are not protected by compatibility guarantees within the framework.
func (ARN) ToStringValue ¶
func (ARN) ToTerraformValue ¶
type CIDRBlock ¶
type CIDRBlock struct {
// contains filtered or unexported fields
}
func CIDRBlockNull ¶
func CIDRBlockNull() CIDRBlock
func CIDRBlockUnknown ¶
func CIDRBlockUnknown() CIDRBlock
func CIDRBlockValue ¶
func (CIDRBlock) ToStringValue ¶
func (CIDRBlock) ToTerraformValue ¶
func (CIDRBlock) ValueCIDRBlock ¶
type Duration ¶
type Duration struct {
// contains filtered or unexported fields
}
func DurationNull ¶
func DurationNull() Duration
func DurationUnknown ¶
func DurationUnknown() Duration
func DurationValue ¶
func (Duration) String ¶
String returns a summary representation of either the underlying Value, or UnknownValueString (`<unknown>`) when IsUnknown() returns true, or NullValueString (`<null>`) when IsNull() return true.
This is an intentionally lossy representation, that are best suited for logging and error reporting, as they are not protected by compatibility guarantees within the framework.
func (Duration) ToStringValue ¶
func (Duration) ToTerraformValue ¶
ToTerraformValue returns the data contained in the *String as a string. If Unknown is true, it returns a tftypes.UnknownValue. If Null is true, it returns nil.
func (Duration) ValueDuration ¶
ValueDuration returns the known time.Duration value. If Duration is null or unknown, returns 0.
type ListNestedObjectTypeOf ¶
ListNestedObjectTypeOf is the attribute type of a ListNestedObjectValueOf.
func NewListNestedObjectTypeOf ¶
func NewListNestedObjectTypeOf[T any](ctx context.Context) ListNestedObjectTypeOf[T]
func (ListNestedObjectTypeOf[T]) NewObjectPtr ¶
func (t ListNestedObjectTypeOf[T]) NewObjectPtr(ctx context.Context) (any, diag.Diagnostics)
func (ListNestedObjectTypeOf[T]) NewObjectSlice ¶
func (t ListNestedObjectTypeOf[T]) NewObjectSlice(ctx context.Context, len, cap int) (any, diag.Diagnostics)
func (ListNestedObjectTypeOf[T]) NullValue ¶
func (t ListNestedObjectTypeOf[T]) NullValue(ctx context.Context) (attr.Value, diag.Diagnostics)
func (ListNestedObjectTypeOf[T]) String ¶
func (t ListNestedObjectTypeOf[T]) String() string
func (ListNestedObjectTypeOf[T]) ValueFromList ¶
func (t ListNestedObjectTypeOf[T]) ValueFromList(ctx context.Context, in basetypes.ListValue) (basetypes.ListValuable, diag.Diagnostics)
func (ListNestedObjectTypeOf[T]) ValueFromObjectPtr ¶
func (t ListNestedObjectTypeOf[T]) ValueFromObjectPtr(ctx context.Context, ptr any) (attr.Value, diag.Diagnostics)
func (ListNestedObjectTypeOf[T]) ValueFromObjectSlice ¶
func (t ListNestedObjectTypeOf[T]) ValueFromObjectSlice(ctx context.Context, slice any) (attr.Value, diag.Diagnostics)
func (ListNestedObjectTypeOf[T]) ValueFromTerraform ¶
type ListNestedObjectValueOf ¶
ListNestedObjectValueOf represents a Terraform Plugin Framework List value whose elements are of type ObjectTypeOf.
func NewListNestedObjectValueOfNull ¶
func NewListNestedObjectValueOfNull[T any](ctx context.Context) ListNestedObjectValueOf[T]
func NewListNestedObjectValueOfPtr ¶
func NewListNestedObjectValueOfPtr[T any](ctx context.Context, t *T) ListNestedObjectValueOf[T]
func NewListNestedObjectValueOfSlice ¶
func NewListNestedObjectValueOfSlice[T any](ctx context.Context, ts []*T) ListNestedObjectValueOf[T]
func NewListNestedObjectValueOfUnknown ¶
func NewListNestedObjectValueOfUnknown[T any](ctx context.Context) ListNestedObjectValueOf[T]
func NewListNestedObjectValueOfValueSlice ¶
func NewListNestedObjectValueOfValueSlice[T any](ctx context.Context, ts []T) ListNestedObjectValueOf[T]
func (ListNestedObjectValueOf[T]) Equal ¶
func (v ListNestedObjectValueOf[T]) Equal(o attr.Value) bool
func (ListNestedObjectValueOf[T]) ToObjectPtr ¶
func (v ListNestedObjectValueOf[T]) ToObjectPtr(ctx context.Context) (any, diag.Diagnostics)
func (ListNestedObjectValueOf[T]) ToObjectSlice ¶
func (v ListNestedObjectValueOf[T]) ToObjectSlice(ctx context.Context) (any, diag.Diagnostics)
type NestedObjectType ¶
type NestedObjectType interface { attr.Type // NewObjectPtr returns a new, empty value as an object pointer (Go *struct). NewObjectPtr(context.Context) (any, diag.Diagnostics) // NewObjectSlice returns a new value as an object slice (Go []*struct). NewObjectSlice(context.Context, int, int) (any, diag.Diagnostics) // NullValue returns a Null Value. NullValue(context.Context) (attr.Value, diag.Diagnostics) // ValueFromObjectPtr returns a Value given an object pointer (Go *struct). ValueFromObjectPtr(context.Context, any) (attr.Value, diag.Diagnostics) // ValueFromObjectSlice returns a Value given an object pointer (Go []*struct). ValueFromObjectSlice(context.Context, any) (attr.Value, diag.Diagnostics) }
NestedObjectType extends the Type interface for types that represent nested Objects.
type NestedObjectValue ¶
type NestedObjectValue interface { attr.Value // ToObjectPtr returns the value as an object pointer (Go *struct). ToObjectPtr(context.Context) (any, diag.Diagnostics) // ToObjectSlice returns the value as an object slice (Go []*struct). ToObjectSlice(context.Context) (any, diag.Diagnostics) }
NestedObjectValue extends the Value interface for values that represent nested Objects.
type ObjectTypeOf ¶
type ObjectTypeOf[T any] struct { basetypes.ObjectType }
ObjectTypeOf is the attribute type of an ObjectValueOf.
func NewObjectTypeOf ¶
func NewObjectTypeOf[T any](ctx context.Context) ObjectTypeOf[T]
func (ObjectTypeOf[T]) String ¶
func (t ObjectTypeOf[T]) String() string
func (ObjectTypeOf[T]) ValueFromObject ¶
func (t ObjectTypeOf[T]) ValueFromObject(ctx context.Context, in basetypes.ObjectValue) (basetypes.ObjectValuable, diag.Diagnostics)
func (ObjectTypeOf[T]) ValueFromTerraform ¶
type ObjectValueOf ¶
type ObjectValueOf[T any] struct { basetypes.ObjectValue }
ObjectValueOf represents a Terraform Plugin Framework Object value whose corresponding Go type is the structure T.
func NewObjectValueOf ¶
func NewObjectValueOf[T any](ctx context.Context, t *T) ObjectValueOf[T]
func NewObjectValueOfNull ¶
func NewObjectValueOfNull[T any](ctx context.Context) ObjectValueOf[T]
func NewObjectValueOfUnknown ¶
func NewObjectValueOfUnknown[T any](ctx context.Context) ObjectValueOf[T]
type Regexp ¶
type Regexp struct {
// contains filtered or unexported fields
}
func RegexpNull ¶
func RegexpNull() Regexp
func RegexpUnknown ¶
func RegexpUnknown() Regexp
func RegexpValue ¶
func (Regexp) String ¶
String returns a summary representation of either the underlying Value, or UnknownValueString (`<unknown>`) when IsUnknown() returns true, or NullValueString (`<null>`) when IsNull() return true.
This is an intentionally lossy representation, that are best suited for logging and error reporting, as they are not protected by compatibility guarantees within the framework.
func (Regexp) ToStringValue ¶
func (Regexp) ToTerraformValue ¶
func (Regexp) ValueRegexp ¶
ValueRegexp returns the known *regexp.Regexp value. If Regexp is null or unknown, returns nil.
type SetNestedObjectTypeOf ¶
SetNestedObjectTypeOf is the attribute type of a SetNestedObjectValueOf.
func NewSetNestedObjectTypeOf ¶
func NewSetNestedObjectTypeOf[T any](ctx context.Context) SetNestedObjectTypeOf[T]
func (SetNestedObjectTypeOf[T]) NewObjectPtr ¶
func (t SetNestedObjectTypeOf[T]) NewObjectPtr(ctx context.Context) (any, diag.Diagnostics)
func (SetNestedObjectTypeOf[T]) NewObjectSlice ¶
func (t SetNestedObjectTypeOf[T]) NewObjectSlice(ctx context.Context, len, cap int) (any, diag.Diagnostics)
func (SetNestedObjectTypeOf[T]) NullValue ¶
func (t SetNestedObjectTypeOf[T]) NullValue(ctx context.Context) (attr.Value, diag.Diagnostics)
func (SetNestedObjectTypeOf[T]) String ¶
func (t SetNestedObjectTypeOf[T]) String() string
func (SetNestedObjectTypeOf[T]) ValueFromObjectPtr ¶
func (t SetNestedObjectTypeOf[T]) ValueFromObjectPtr(ctx context.Context, ptr any) (attr.Value, diag.Diagnostics)
func (SetNestedObjectTypeOf[T]) ValueFromObjectSlice ¶
func (t SetNestedObjectTypeOf[T]) ValueFromObjectSlice(ctx context.Context, slice any) (attr.Value, diag.Diagnostics)
func (SetNestedObjectTypeOf[T]) ValueFromSet ¶
func (t SetNestedObjectTypeOf[T]) ValueFromSet(ctx context.Context, in basetypes.SetValue) (basetypes.SetValuable, diag.Diagnostics)
func (SetNestedObjectTypeOf[T]) ValueFromTerraform ¶
type SetNestedObjectValueOf ¶
SetNestedObjectValueOf represents a Terraform Plugin Framework Set value whose elements are of type ObjectTypeOf.
func NewSetNestedObjectValueOfNull ¶
func NewSetNestedObjectValueOfNull[T any](ctx context.Context) SetNestedObjectValueOf[T]
func NewSetNestedObjectValueOfPtr ¶
func NewSetNestedObjectValueOfPtr[T any](ctx context.Context, t *T) SetNestedObjectValueOf[T]
func NewSetNestedObjectValueOfSlice ¶
func NewSetNestedObjectValueOfSlice[T any](ctx context.Context, ts []*T) SetNestedObjectValueOf[T]
func NewSetNestedObjectValueOfUnknown ¶
func NewSetNestedObjectValueOfUnknown[T any](ctx context.Context) SetNestedObjectValueOf[T]
func NewSetNestedObjectValueOfValueSlice ¶
func NewSetNestedObjectValueOfValueSlice[T any](ctx context.Context, ts []T) SetNestedObjectValueOf[T]
func (SetNestedObjectValueOf[T]) Equal ¶
func (v SetNestedObjectValueOf[T]) Equal(o attr.Value) bool
func (SetNestedObjectValueOf[T]) ToObjectPtr ¶
func (v SetNestedObjectValueOf[T]) ToObjectPtr(ctx context.Context) (any, diag.Diagnostics)
func (SetNestedObjectValueOf[T]) ToObjectSlice ¶
func (v SetNestedObjectValueOf[T]) ToObjectSlice(ctx context.Context) (any, diag.Diagnostics)
type TimestampType ¶
type TimestampType struct {
basetypes.StringType
}
func (TimestampType) String ¶
func (typ TimestampType) String() string
String returns a human-friendly description of the TimestampType.
func (TimestampType) Validate ¶
func (typ TimestampType) Validate(ctx context.Context, in tftypes.Value, path path.Path) diag.Diagnostics
func (TimestampType) ValueFromString ¶
func (typ TimestampType) ValueFromString(_ context.Context, in basetypes.StringValue) (basetypes.StringValuable, diag.Diagnostics)
func (TimestampType) ValueFromTerraform ¶
type TimestampValue ¶
type TimestampValue struct { basetypes.StringValue // contains filtered or unexported fields }
func NewTimestampNull ¶
func NewTimestampNull() TimestampValue
func NewTimestampUnknown ¶
func NewTimestampUnknown() TimestampValue
func NewTimestampValue ¶
func NewTimestampValue(t time.Time) TimestampValue
func NewTimestampValueString ¶
func NewTimestampValueString(s string) (TimestampValue, error)
func (TimestampValue) ValueTimestamp ¶
func (val TimestampValue) ValueTimestamp() time.Time
ValueTimestamp returns the known time.Time value. If Timestamp is null or unknown, returns 0. To get the value as a string, use ValueString.