types

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: MPL-2.0 Imports: 5 Imported by: 895

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

Constants

This section is empty.

Variables

View Source
var BoolType = basetypes.BoolType{}
View Source
var DynamicType = basetypes.DynamicType{}
View Source
var Float32Type = basetypes.Float32Type{}
View Source
var Float64Type = basetypes.Float64Type{}
View Source
var Int32Type = basetypes.Int32Type{}
View Source
var Int64Type = basetypes.Int64Type{}
View Source
var NumberType = basetypes.NumberType{}
View Source
var StringType = basetypes.StringType{}

Functions

func BoolNull added in v0.15.0

func BoolNull() basetypes.BoolValue

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

func BoolPointerValue(value *bool) basetypes.BoolValue

BoolPointerValue creates a Bool with a null value if nil or a known value.

func BoolUnknown added in v0.15.0

func BoolUnknown() basetypes.BoolValue

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

func BoolValue(value bool) basetypes.BoolValue

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

func ListNull(elementType attr.Type) basetypes.ListValue

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

func ListUnknown(elementType attr.Type) basetypes.ListValue

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

func ListValueMust(elementType attr.Type, elements []attr.Value) basetypes.ListValue

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

func MapNull(elementType attr.Type) basetypes.MapValue

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

func MapUnknown(elementType attr.Type) basetypes.MapValue

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

func MapValueMust(elementType attr.Type, elements map[string]attr.Value) basetypes.MapValue

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

func SetNull(elementType attr.Type) basetypes.SetValue

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

func SetUnknown(elementType attr.Type) basetypes.SetValue

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

func SetValue(elementType attr.Type, elements []attr.Value) (basetypes.SetValue, diag.Diagnostics)

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

func SetValueMust(elementType attr.Type, elements []attr.Value) basetypes.SetValue

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

func TupleValueMust(elementTypes []attr.Type, elements []attr.Value) basetypes.TupleValue

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 Bool

type Bool = basetypes.BoolValue

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 List

type List = basetypes.ListValue

type ListType

type ListType = basetypes.ListType

type Map

type Map = basetypes.MapValue

type MapType

type MapType = basetypes.MapType

type Number

type Number = basetypes.NumberValue

type Object

type Object = basetypes.ObjectValue

type ObjectType

type ObjectType = basetypes.ObjectType

type Set added in v0.4.0

type Set = basetypes.SetValue

type SetType added in v0.4.0

type SetType = basetypes.SetType

type String

type String = basetypes.StringValue

type Tuple added in v1.5.0

type Tuple = basetypes.TupleValue

type TupleType added in v1.5.0

type TupleType = basetypes.TupleType

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.

Jump to

Keyboard shortcuts

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