Documentation ¶
Overview ¶
Package types contains the framework-defined data types and values, such as boolean, floating point, integer, list, map, object, set, and string.
This package contains creation functions and type aliases for most provider use cases. The actual schema-ready type and value type implementations are under the basetypes package. Embed those basetypes implementations to create custom types.
Index ¶
- Variables
- func BoolNull() basetypes.BoolValue
- func BoolPointerValue(value *bool) basetypes.BoolValue
- func BoolUnknown() basetypes.BoolValue
- func BoolValue(value bool) basetypes.BoolValue
- func DynamicNull() basetypes.DynamicValue
- func DynamicUnknown() basetypes.DynamicValue
- func DynamicValue(value attr.Value) basetypes.DynamicValue
- func Float32Null() basetypes.Float32Value
- func Float32PointerValue(value *float32) basetypes.Float32Value
- func Float32Unknown() basetypes.Float32Value
- func Float32Value(value float32) basetypes.Float32Value
- func Float64Null() basetypes.Float64Value
- func Float64PointerValue(value *float64) basetypes.Float64Value
- func Float64Unknown() basetypes.Float64Value
- func Float64Value(value float64) basetypes.Float64Value
- func Int32Null() basetypes.Int32Value
- func Int32PointerValue(value *int32) basetypes.Int32Value
- func Int32Unknown() basetypes.Int32Value
- func Int32Value(value int32) basetypes.Int32Value
- func Int64Null() basetypes.Int64Value
- func Int64PointerValue(value *int64) basetypes.Int64Value
- func Int64Unknown() basetypes.Int64Value
- func Int64Value(value int64) basetypes.Int64Value
- func ListNull(elementType attr.Type) basetypes.ListValue
- func ListUnknown(elementType attr.Type) basetypes.ListValue
- func ListValue(elementType attr.Type, elements []attr.Value) (basetypes.ListValue, diag.Diagnostics)
- func ListValueFrom(ctx context.Context, elementType attr.Type, elements any) (basetypes.ListValue, diag.Diagnostics)
- func ListValueMust(elementType attr.Type, elements []attr.Value) basetypes.ListValue
- func MapNull(elementType attr.Type) basetypes.MapValue
- func MapUnknown(elementType attr.Type) basetypes.MapValue
- func MapValue(elementType attr.Type, elements map[string]attr.Value) (basetypes.MapValue, diag.Diagnostics)
- func MapValueFrom(ctx context.Context, elementType attr.Type, elements any) (basetypes.MapValue, diag.Diagnostics)
- func MapValueMust(elementType attr.Type, elements map[string]attr.Value) basetypes.MapValue
- func NumberNull() basetypes.NumberValue
- func NumberUnknown() basetypes.NumberValue
- func NumberValue(value *big.Float) basetypes.NumberValue
- func ObjectNull(attributeTypes map[string]attr.Type) basetypes.ObjectValue
- func ObjectUnknown(attributeTypes map[string]attr.Type) basetypes.ObjectValue
- func ObjectValue(attributeTypes map[string]attr.Type, attributes map[string]attr.Value) (basetypes.ObjectValue, diag.Diagnostics)
- func ObjectValueFrom(ctx context.Context, attributeTypes map[string]attr.Type, attributes any) (basetypes.ObjectValue, diag.Diagnostics)
- func ObjectValueMust(attributeTypes map[string]attr.Type, attributes map[string]attr.Value) basetypes.ObjectValue
- func SetNull(elementType attr.Type) basetypes.SetValue
- func SetUnknown(elementType attr.Type) basetypes.SetValue
- func SetValue(elementType attr.Type, elements []attr.Value) (basetypes.SetValue, diag.Diagnostics)
- func SetValueFrom(ctx context.Context, elementType attr.Type, elements any) (basetypes.SetValue, diag.Diagnostics)
- func SetValueMust(elementType attr.Type, elements []attr.Value) basetypes.SetValue
- func StringNull() basetypes.StringValue
- func StringPointerValue(value *string) basetypes.StringValue
- func StringUnknown() basetypes.StringValue
- func StringValue(value string) basetypes.StringValue
- func TupleNull(elementTypes []attr.Type) basetypes.TupleValue
- func TupleUnknown(elementTypes []attr.Type) basetypes.TupleValue
- func TupleValue(elementTypes []attr.Type, elements []attr.Value) (basetypes.TupleValue, diag.Diagnostics)
- func TupleValueMust(elementTypes []attr.Type, elements []attr.Value) basetypes.TupleValue
- type Bool
- type Dynamic
- type Float32
- type Float64
- type Int32
- type Int64
- type List
- type ListType
- type Map
- type MapType
- type Number
- type Object
- type ObjectType
- type Set
- type SetType
- type String
- type Tuple
- type TupleType
Constants ¶
This section is empty.
Variables ¶
var BoolType = basetypes.BoolType{}
var DynamicType = basetypes.DynamicType{}
var Float32Type = basetypes.Float32Type{}
var Float64Type = basetypes.Float64Type{}
var Int32Type = basetypes.Int32Type{}
var Int64Type = basetypes.Int64Type{}
var NumberType = basetypes.NumberType{}
var StringType = basetypes.StringType{}
Functions ¶
func BoolNull ¶ added in v0.15.0
BoolNull creates a Bool with a null value. Determine whether the value is null via the Bool type IsNull method.
func BoolPointerValue ¶ added in v1.2.0
BoolPointerValue creates a Bool with a null value if nil or a known value.
func BoolUnknown ¶ added in v0.15.0
BoolUnknown creates a Bool with an unknown value. Determine whether the value is unknown via the Bool type IsUnknown method.
func BoolValue ¶ added in v0.15.0
BoolValue creates a Bool with a known value. Access the value via the Bool type ValueBool method.
func DynamicNull ¶ added in v1.7.0
func DynamicNull() basetypes.DynamicValue
DynamicNull creates a Dynamic with a null value. Determine whether the value is null via the Dynamic type IsNull method.
func DynamicUnknown ¶ added in v1.7.0
func DynamicUnknown() basetypes.DynamicValue
DynamicUnknown creates a Dynamic with an unknown value. Determine whether the value is unknown via the Dynamic type IsUnknown method.
func DynamicValue ¶ added in v1.7.0
func DynamicValue(value attr.Value) basetypes.DynamicValue
DynamicValue creates a Dynamic with a known value. Access the value via the Dynamic type UnderlyingValue method.
func Float32Null ¶ added in v1.10.0
func Float32Null() basetypes.Float32Value
Float32Null creates a Float32 with a null value. Determine whether the value is null via the Float32 type IsNull method.
func Float32PointerValue ¶ added in v1.10.0
func Float32PointerValue(value *float32) basetypes.Float32Value
Float32PointerValue creates a Float32 with a null value if nil or a known value.
func Float32Unknown ¶ added in v1.10.0
func Float32Unknown() basetypes.Float32Value
Float32Unknown creates a Float32 with an unknown value. Determine whether the value is unknown via the Float32 type IsUnknown method.
func Float32Value ¶ added in v1.10.0
func Float32Value(value float32) basetypes.Float32Value
Float32Value creates a Float32 with a known value. Access the value via the Float32 type ValueFloat32 method.
func Float64Null ¶ added in v0.15.0
func Float64Null() basetypes.Float64Value
Float64Null creates a Float64 with a null value. Determine whether the value is null via the Float64 type IsNull method.
func Float64PointerValue ¶ added in v1.2.0
func Float64PointerValue(value *float64) basetypes.Float64Value
Float64PointerValue creates a Float64 with a null value if nil or a known value.
func Float64Unknown ¶ added in v0.15.0
func Float64Unknown() basetypes.Float64Value
Float64Unknown creates a Float64 with an unknown value. Determine whether the value is unknown via the Float64 type IsUnknown method.
func Float64Value ¶ added in v0.15.0
func Float64Value(value float64) basetypes.Float64Value
Float64Value creates a Float64 with a known value. Access the value via the Float64 type ValueFloat64 method.
func Int32Null ¶ added in v1.10.0
func Int32Null() basetypes.Int32Value
Int32Null creates a Int32 with a null value. Determine whether the value is null via the Int32 type IsNull method.
func Int32PointerValue ¶ added in v1.10.0
func Int32PointerValue(value *int32) basetypes.Int32Value
Int32PointerValue creates a Int32 with a null value if nil or a known value.
func Int32Unknown ¶ added in v1.10.0
func Int32Unknown() basetypes.Int32Value
Int32Unknown creates a Int32 with an unknown value. Determine whether the value is unknown via the Int32 type IsUnknown method.
func Int32Value ¶ added in v1.10.0
func Int32Value(value int32) basetypes.Int32Value
Int32Value creates a Int32 with a known value. Access the value via the Int32 type ValueInt32 method.
func Int64Null ¶ added in v0.15.0
func Int64Null() basetypes.Int64Value
Int64Null creates a Int64 with a null value. Determine whether the value is null via the Int64 type IsNull method.
func Int64PointerValue ¶ added in v1.2.0
func Int64PointerValue(value *int64) basetypes.Int64Value
Int64PointerValue creates a Int64 with a null value if nil or a known value.
func Int64Unknown ¶ added in v0.15.0
func Int64Unknown() basetypes.Int64Value
Int64Unknown creates a Int64 with an unknown value. Determine whether the value is unknown via the Int64 type IsUnknown method.
func Int64Value ¶ added in v0.15.0
func Int64Value(value int64) basetypes.Int64Value
Int64Value creates a Int64 with a known value. Access the value via the Int64 type ValueInt64 method.
func ListNull ¶ added in v0.15.0
ListNull creates a List with a null value. Determine whether the value is null via the List type IsNull method.
func ListUnknown ¶ added in v0.15.0
ListUnknown creates a List with an unknown value. Determine whether the value is unknown via the List type IsUnknown method.
func ListValue ¶ added in v0.15.0
func ListValue(elementType attr.Type, elements []attr.Value) (basetypes.ListValue, diag.Diagnostics)
ListValue creates a List with a known value. Access the value via the List type Elements or ElementsAs methods.
func ListValueFrom ¶ added in v0.15.0
func ListValueFrom(ctx context.Context, elementType attr.Type, elements any) (basetypes.ListValue, diag.Diagnostics)
ListValueFrom creates a List with a known value, using reflection rules. The elements must be a slice which can convert into the given element type. Access the value via the List type Elements or ElementsAs methods.
func ListValueMust ¶ added in v0.15.0
ListValueMust creates a List with a known value, converting any diagnostics into a panic at runtime. Access the value via the List type Elements or ElementsAs methods.
This creation function is only recommended to create List values which will not potentially affect practitioners, such as testing, or exhaustively tested provider logic.
func MapNull ¶ added in v0.15.0
MapNull creates a Map with a null value. Determine whether the value is null via the Map type IsNull method.
func MapUnknown ¶ added in v0.15.0
MapUnknown creates a Map with an unknown value. Determine whether the value is unknown via the Map type IsUnknown method.
func MapValue ¶ added in v0.15.0
func MapValue(elementType attr.Type, elements map[string]attr.Value) (basetypes.MapValue, diag.Diagnostics)
MapValue creates a Map with a known value. Access the value via the Map type Elements or ElementsAs methods.
func MapValueFrom ¶ added in v0.15.0
func MapValueFrom(ctx context.Context, elementType attr.Type, elements any) (basetypes.MapValue, diag.Diagnostics)
MapValueFrom creates a Map with a known value, using reflection rules. The elements must be a map which can convert into the given element type. Access the value via the Map type Elements or ElementsAs methods.
func MapValueMust ¶ added in v0.15.0
MapValueMust creates a Map with a known value, converting any diagnostics into a panic at runtime. Access the value via the Map type Elements or ElementsAs methods.
This creation function is only recommended to create Map values which will not potentially affect practitioners, such as testing, or exhaustively tested provider logic.
func NumberNull ¶ added in v0.15.0
func NumberNull() basetypes.NumberValue
NumberNull creates a Number with a null value. Determine whether the value is null via the Number type IsNull method.
func NumberUnknown ¶ added in v0.15.0
func NumberUnknown() basetypes.NumberValue
NumberUnknown creates a Number with an unknown value. Determine whether the value is unknown via the Number type IsUnknown method.
func NumberValue ¶ added in v0.15.0
func NumberValue(value *big.Float) basetypes.NumberValue
NumberValue creates a Number with a known value. Access the value via the Number type ValueBigFloat method. If the given value is nil, a null Number is created.
func ObjectNull ¶ added in v0.15.0
func ObjectNull(attributeTypes map[string]attr.Type) basetypes.ObjectValue
ObjectNull creates a Object with a null value. Determine whether the value is null via the Object type IsNull method.
func ObjectUnknown ¶ added in v0.15.0
func ObjectUnknown(attributeTypes map[string]attr.Type) basetypes.ObjectValue
ObjectUnknown creates a Object with an unknown value. Determine whether the value is unknown via the Object type IsUnknown method.
func ObjectValue ¶ added in v0.15.0
func ObjectValue(attributeTypes map[string]attr.Type, attributes map[string]attr.Value) (basetypes.ObjectValue, diag.Diagnostics)
ObjectValue creates a Object with a known value. Access the value via the Object type Attributes or As methods.
func ObjectValueFrom ¶ added in v0.15.0
func ObjectValueFrom(ctx context.Context, attributeTypes map[string]attr.Type, attributes any) (basetypes.ObjectValue, diag.Diagnostics)
ObjectValueFrom creates a Object with a known value, using reflection rules. The attributes must be a struct which can convert into the given attribute types. Access the value via the Object type Attributes or As methods.
func ObjectValueMust ¶ added in v0.15.0
func ObjectValueMust(attributeTypes map[string]attr.Type, attributes map[string]attr.Value) basetypes.ObjectValue
ObjectValueMust creates a Object with a known value, converting any diagnostics into a panic at runtime. Access the value via the Object type Attributes or As methods.
This creation function is only recommended to create Object values which will not potentially affect practitioners, such as testing, or exhaustively tested provider logic.
func SetNull ¶ added in v0.15.0
SetNull creates a Set with a null value. Determine whether the value is null via the Set type IsNull method.
func SetUnknown ¶ added in v0.15.0
SetUnknown creates a Set with an unknown value. Determine whether the value is unknown via the Set type IsUnknown method.
func SetValue ¶ added in v0.15.0
SetValue creates a Set with a known value. Access the value via the Set type Elements or ElementsAs methods.
func SetValueFrom ¶ added in v0.15.0
func SetValueFrom(ctx context.Context, elementType attr.Type, elements any) (basetypes.SetValue, diag.Diagnostics)
SetValueFrom creates a Set with a known value, using reflection rules. The elements must be a slice which can convert into the given element type. Access the value via the Set type Elements or ElementsAs methods.
func SetValueMust ¶ added in v0.15.0
SetValueMust creates a Set with a known value, converting any diagnostics into a panic at runtime. Access the value via the Set type Elements or ElementsAs methods.
This creation function is only recommended to create Set values which will not potentially affect practitioners, such as testing, or exhaustively tested provider logic.
func StringNull ¶ added in v0.15.0
func StringNull() basetypes.StringValue
StringNull creates a String with a null value. Determine whether the value is null via the String type IsNull method.
func StringPointerValue ¶ added in v1.2.0
func StringPointerValue(value *string) basetypes.StringValue
StringPointerValue creates a String with a null value if nil or a known value.
func StringUnknown ¶ added in v0.15.0
func StringUnknown() basetypes.StringValue
StringUnknown creates a String with an unknown value. Determine whether the value is unknown via the String type IsUnknown method.
func StringValue ¶ added in v0.15.0
func StringValue(value string) basetypes.StringValue
StringValue creates a String with a known value. Access the value via the String type ValueString method.
func TupleNull ¶ added in v1.5.0
func TupleNull(elementTypes []attr.Type) basetypes.TupleValue
TupleNull creates a Tuple with a null value. Determine whether the value is null via the Tuple type IsNull method.
func TupleUnknown ¶ added in v1.5.0
func TupleUnknown(elementTypes []attr.Type) basetypes.TupleValue
TupleUnknown creates a Tuple with an unknown value. Determine whether the value is unknown via the Tuple type IsUnknown method.
func TupleValue ¶ added in v1.5.0
func TupleValue(elementTypes []attr.Type, elements []attr.Value) (basetypes.TupleValue, diag.Diagnostics)
TupleValue creates a Tuple with a known value. Access the value via the Tuple type Elements method.
func TupleValueMust ¶ added in v1.5.0
TupleValueMust creates a Tuple with a known value, converting any diagnostics into a panic at runtime. Access the value via the Tuple type Elements method.
This creation function is only recommended to create Tuple values which will not potentially affect practitioners, such as testing, or exhaustively tested provider logic.
Types ¶
type Dynamic ¶ added in v1.7.0
type Dynamic = basetypes.DynamicValue
type Float32 ¶ added in v1.10.0
type Float32 = basetypes.Float32Value
type Float64 ¶ added in v0.4.0
type Float64 = basetypes.Float64Value
type Int32 ¶ added in v1.10.0
type Int32 = basetypes.Int32Value
type Int64 ¶ added in v0.4.0
type Int64 = basetypes.Int64Value
type Number ¶
type Number = basetypes.NumberValue
type Object ¶
type Object = basetypes.ObjectValue
type ObjectType ¶
type ObjectType = basetypes.ObjectType
type String ¶
type String = basetypes.StringValue
type Tuple ¶ added in v1.5.0
type Tuple = basetypes.TupleValue
Source Files ¶
- bool_type.go
- bool_value.go
- doc.go
- dynamic_type.go
- dynamic_value.go
- float32_type.go
- float32_value.go
- float64_type.go
- float64_value.go
- int32_type.go
- int32_value.go
- int64_type.go
- int64_value.go
- list_type.go
- list_value.go
- map_type.go
- map_value.go
- number_type.go
- number_value.go
- object_type.go
- object_value.go
- set_type.go
- set_value.go
- string_type.go
- string_value.go
- tuple_type.go
- tuple_value.go
Directories ¶
Path | Synopsis |
---|---|
Package basetypes contains the implementations for framework-defined data types and values, such as boolean, floating point, integer, list, map, object, set, and string.
|
Package basetypes contains the implementations for framework-defined data types and values, such as boolean, floating point, integer, list, map, object, set, and string. |