types

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2023 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Overview

types contains shared attr.Type implementations for unit testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TestErrorDiagnostic

func TestErrorDiagnostic(path path.Path) diag.DiagnosticWithPath

func TestWarningDiagnostic

func TestWarningDiagnostic(path path.Path) diag.DiagnosticWithPath

Types

type Bool

type Bool struct {
	types.Bool

	CreatedBy attr.Type
}

func (Bool) Equal

func (b Bool) Equal(o attr.Value) bool

func (Bool) IsNull added in v0.9.0

func (b Bool) IsNull() bool

func (Bool) IsUnknown added in v0.9.0

func (b Bool) IsUnknown() bool

func (Bool) String added in v0.9.0

func (b Bool) String() string

func (Bool) Type

func (b Bool) Type(_ context.Context) attr.Type

type BoolType

type BoolType struct{}

BoolType is a reimplementation of types.BoolType that can be used as a base for other extension types in testing.

func (BoolType) ApplyTerraform5AttributePathStep

func (t BoolType) ApplyTerraform5AttributePathStep(step tftypes.AttributePathStep) (interface{}, error)

func (BoolType) Equal

func (t BoolType) Equal(o attr.Type) bool

func (BoolType) String

func (t BoolType) String() string

func (BoolType) TerraformType

func (t BoolType) TerraformType(_ context.Context) tftypes.Type

func (BoolType) ValueFromBool added in v0.17.0

func (BoolType) ValueFromTerraform

func (t BoolType) ValueFromTerraform(ctx context.Context, in tftypes.Value) (attr.Value, error)

func (BoolType) ValueType added in v0.14.0

func (t BoolType) ValueType(_ context.Context) attr.Value

ValueType returns the Value type.

type BoolTypeWithSemanticEquals added in v1.3.0

type BoolTypeWithSemanticEquals struct {
	basetypes.BoolType

	SemanticEquals            bool
	SemanticEqualsDiagnostics diag.Diagnostics
}

BoolTypeWithSemanticEquals is a BoolType associated with BoolValueWithSemanticEquals, which implements semantic equality logic that returns the SemanticEquals boolean for testing.

func (BoolTypeWithSemanticEquals) Equal added in v1.3.0

func (BoolTypeWithSemanticEquals) String added in v1.3.0

func (BoolTypeWithSemanticEquals) ValueFromBool added in v1.3.0

func (BoolTypeWithSemanticEquals) ValueFromTerraform added in v1.3.0

func (t BoolTypeWithSemanticEquals) ValueFromTerraform(ctx context.Context, in tftypes.Value) (attr.Value, error)

func (BoolTypeWithSemanticEquals) ValueType added in v1.3.0

type BoolTypeWithValidateError

type BoolTypeWithValidateError struct {
	BoolType
}

func (BoolTypeWithValidateError) Validate

func (BoolTypeWithValidateError) ValueFromTerraform

func (b BoolTypeWithValidateError) ValueFromTerraform(ctx context.Context, in tftypes.Value) (attr.Value, error)

type BoolTypeWithValidateWarning

type BoolTypeWithValidateWarning struct {
	BoolType
}

func (BoolTypeWithValidateWarning) Validate

func (BoolTypeWithValidateWarning) ValueFromTerraform

func (b BoolTypeWithValidateWarning) ValueFromTerraform(ctx context.Context, in tftypes.Value) (attr.Value, error)

type BoolValueWithSemanticEquals added in v1.3.0

type BoolValueWithSemanticEquals struct {
	basetypes.BoolValue

	SemanticEquals            bool
	SemanticEqualsDiagnostics diag.Diagnostics
}

func (BoolValueWithSemanticEquals) BoolSemanticEquals added in v1.3.0

func (BoolValueWithSemanticEquals) Equal added in v1.3.0

func (BoolValueWithSemanticEquals) Type added in v1.3.0

type Float64TypeWithSemanticEquals added in v1.3.0

type Float64TypeWithSemanticEquals struct {
	basetypes.Float64Type

	SemanticEquals            bool
	SemanticEqualsDiagnostics diag.Diagnostics
}

Float64TypeWithSemanticEquals is a Float64Type associated with Float64ValueWithSemanticEquals, which implements semantic equality logic that returns the SemanticEquals boolean for testing.

func (Float64TypeWithSemanticEquals) Equal added in v1.3.0

func (Float64TypeWithSemanticEquals) String added in v1.3.0

func (Float64TypeWithSemanticEquals) ValueFromFloat64 added in v1.3.0

func (Float64TypeWithSemanticEquals) ValueFromTerraform added in v1.3.0

func (t Float64TypeWithSemanticEquals) ValueFromTerraform(ctx context.Context, in tftypes.Value) (attr.Value, error)

func (Float64TypeWithSemanticEquals) ValueType added in v1.3.0

type Float64ValueWithSemanticEquals added in v1.3.0

type Float64ValueWithSemanticEquals struct {
	basetypes.Float64Value

	SemanticEquals            bool
	SemanticEqualsDiagnostics diag.Diagnostics
}

func (Float64ValueWithSemanticEquals) Equal added in v1.3.0

func (Float64ValueWithSemanticEquals) Float64SemanticEquals added in v1.3.0

func (Float64ValueWithSemanticEquals) Type added in v1.3.0

type Int64TypeWithSemanticEquals added in v1.3.0

type Int64TypeWithSemanticEquals struct {
	basetypes.Int64Type

	SemanticEquals            bool
	SemanticEqualsDiagnostics diag.Diagnostics
}

Int64TypeWithSemanticEquals is a Int64Type associated with Int64ValueWithSemanticEquals, which implements semantic equality logic that returns the SemanticEquals boolean for testing.

func (Int64TypeWithSemanticEquals) Equal added in v1.3.0

func (Int64TypeWithSemanticEquals) String added in v1.3.0

func (Int64TypeWithSemanticEquals) ValueFromInt64 added in v1.3.0

func (Int64TypeWithSemanticEquals) ValueFromTerraform added in v1.3.0

func (t Int64TypeWithSemanticEquals) ValueFromTerraform(ctx context.Context, in tftypes.Value) (attr.Value, error)

func (Int64TypeWithSemanticEquals) ValueType added in v1.3.0

type Int64ValueWithSemanticEquals added in v1.3.0

type Int64ValueWithSemanticEquals struct {
	basetypes.Int64Value

	SemanticEquals            bool
	SemanticEqualsDiagnostics diag.Diagnostics
}

func (Int64ValueWithSemanticEquals) Equal added in v1.3.0

func (Int64ValueWithSemanticEquals) Int64SemanticEquals added in v1.3.0

func (Int64ValueWithSemanticEquals) Type added in v1.3.0

type Invalid added in v0.10.0

type Invalid struct{}

Invalid is an attr.Value that returns errors for methods than can return errors.

func (Invalid) Equal added in v0.10.0

func (i Invalid) Equal(o attr.Value) bool

func (Invalid) IsNull added in v0.10.0

func (i Invalid) IsNull() bool

func (Invalid) IsUnknown added in v0.10.0

func (i Invalid) IsUnknown() bool

func (Invalid) String added in v0.10.0

func (i Invalid) String() string

func (Invalid) ToTerraformValue added in v0.10.0

func (i Invalid) ToTerraformValue(ctx context.Context) (tftypes.Value, error)

func (Invalid) Type added in v0.10.0

func (i Invalid) Type(_ context.Context) attr.Type

type InvalidType added in v0.10.0

type InvalidType struct{}

InvalidType is an attr.Type that returns errors for methods that can return errors.

func (InvalidType) ApplyTerraform5AttributePathStep added in v0.10.0

func (t InvalidType) ApplyTerraform5AttributePathStep(step tftypes.AttributePathStep) (interface{}, error)

func (InvalidType) Equal added in v0.10.0

func (t InvalidType) Equal(o attr.Type) bool

func (InvalidType) String added in v0.10.0

func (t InvalidType) String() string

func (InvalidType) TerraformType added in v0.10.0

func (t InvalidType) TerraformType(_ context.Context) tftypes.Type

func (InvalidType) ValueFromTerraform added in v0.10.0

func (t InvalidType) ValueFromTerraform(ctx context.Context, in tftypes.Value) (attr.Value, error)

func (InvalidType) ValueType added in v0.14.0

func (t InvalidType) ValueType(_ context.Context) attr.Value

ValueType returns the Value type.

type ListNestedAttributesCustomTypeType added in v0.16.0

type ListNestedAttributesCustomTypeType struct {
	types.ListType
}

func (ListNestedAttributesCustomTypeType) ValueFromTerraform added in v0.16.0

func (tt ListNestedAttributesCustomTypeType) ValueFromTerraform(ctx context.Context, value tftypes.Value) (attr.Value, error)

type ListNestedAttributesCustomValue added in v0.16.0

type ListNestedAttributesCustomValue struct {
	types.List
}

type ListType added in v1.3.0

type ListType struct {
	basetypes.ListType
}

type ListTypeWithSemanticEquals added in v1.3.0

type ListTypeWithSemanticEquals struct {
	basetypes.ListType

	SemanticEquals            bool
	SemanticEqualsDiagnostics diag.Diagnostics
}

ListTypeWithSemanticEquals is a ListType associated with ListValueWithSemanticEquals, which implements semantic equality logic that returns the SemanticEquals boolean for testing.

func (ListTypeWithSemanticEquals) Equal added in v1.3.0

func (ListTypeWithSemanticEquals) String added in v1.3.0

func (ListTypeWithSemanticEquals) ValueFromList added in v1.3.0

func (ListTypeWithSemanticEquals) ValueFromTerraform added in v1.3.0

func (t ListTypeWithSemanticEquals) ValueFromTerraform(ctx context.Context, in tftypes.Value) (attr.Value, error)

func (ListTypeWithSemanticEquals) ValueType added in v1.3.0

type ListTypeWithValidateError added in v0.4.0

type ListTypeWithValidateError struct {
	types.ListType
}

func (ListTypeWithValidateError) Validate added in v0.4.0

type ListTypeWithValidateWarning added in v0.4.0

type ListTypeWithValidateWarning struct {
	types.ListType
}

func (ListTypeWithValidateWarning) Validate added in v0.4.0

type ListValue added in v1.3.0

type ListValue struct {
	basetypes.ListValue
}

type ListValueWithSemanticEquals added in v1.3.0

type ListValueWithSemanticEquals struct {
	basetypes.ListValue

	SemanticEquals            bool
	SemanticEqualsDiagnostics diag.Diagnostics
}

func (ListValueWithSemanticEquals) Equal added in v1.3.0

func (ListValueWithSemanticEquals) ListSemanticEquals added in v1.3.0

func (ListValueWithSemanticEquals) Type added in v1.3.0

type MapNestedAttributesCustomTypeType added in v0.16.0

type MapNestedAttributesCustomTypeType struct {
	types.MapType
}

func (MapNestedAttributesCustomTypeType) ValueFromTerraform added in v0.16.0

func (tt MapNestedAttributesCustomTypeType) ValueFromTerraform(ctx context.Context, value tftypes.Value) (attr.Value, error)

type MapNestedAttributesCustomValue added in v0.16.0

type MapNestedAttributesCustomValue struct {
	types.Map
}

type MapType added in v1.3.0

type MapType struct {
	basetypes.MapType
}

type MapTypeWithSemanticEquals added in v1.3.0

type MapTypeWithSemanticEquals struct {
	basetypes.MapType

	SemanticEquals            bool
	SemanticEqualsDiagnostics diag.Diagnostics
}

MapTypeWithSemanticEquals is a MapType associated with MapValueWithSemanticEquals, which implements semantic equality logic that returns the SemanticEquals boolean for testing.

func (MapTypeWithSemanticEquals) Equal added in v1.3.0

func (MapTypeWithSemanticEquals) String added in v1.3.0

func (t MapTypeWithSemanticEquals) String() string

func (MapTypeWithSemanticEquals) ValueFromMap added in v1.3.0

func (MapTypeWithSemanticEquals) ValueFromTerraform added in v1.3.0

func (t MapTypeWithSemanticEquals) ValueFromTerraform(ctx context.Context, in tftypes.Value) (attr.Value, error)

func (MapTypeWithSemanticEquals) ValueType added in v1.3.0

type MapTypeWithValidateError added in v0.4.0

type MapTypeWithValidateError struct {
	types.MapType
}

func (MapTypeWithValidateError) Validate added in v0.4.0

type MapTypeWithValidateWarning added in v0.4.0

type MapTypeWithValidateWarning struct {
	types.MapType
}

func (MapTypeWithValidateWarning) Validate added in v0.4.0

type MapValue added in v1.3.0

type MapValue struct {
	basetypes.MapValue
}

type MapValueWithSemanticEquals added in v1.3.0

type MapValueWithSemanticEquals struct {
	basetypes.MapValue

	SemanticEquals            bool
	SemanticEqualsDiagnostics diag.Diagnostics
}

func (MapValueWithSemanticEquals) Equal added in v1.3.0

func (MapValueWithSemanticEquals) MapSemanticEquals added in v1.3.0

func (MapValueWithSemanticEquals) Type added in v1.3.0

type Number

type Number struct {
	types.Number

	CreatedBy attr.Type
}

func (Number) Equal

func (n Number) Equal(o attr.Value) bool

func (Number) IsNull added in v0.9.0

func (n Number) IsNull() bool

func (Number) IsUnknown added in v0.9.0

func (n Number) IsUnknown() bool

func (Number) Type

func (n Number) Type(_ context.Context) attr.Type

type NumberType

type NumberType struct{}

NumberType is a reimplementation of types.NumberType that can be used as a base for other extension types in testing.

func (NumberType) ApplyTerraform5AttributePathStep

func (t NumberType) ApplyTerraform5AttributePathStep(step tftypes.AttributePathStep) (interface{}, error)

func (NumberType) Equal

func (t NumberType) Equal(o attr.Type) bool

func (NumberType) String

func (t NumberType) String() string

func (NumberType) TerraformType

func (t NumberType) TerraformType(_ context.Context) tftypes.Type

func (NumberType) ValueFromNumber added in v0.17.0

func (NumberType) ValueFromTerraform

func (t NumberType) ValueFromTerraform(ctx context.Context, in tftypes.Value) (attr.Value, error)

func (NumberType) ValueType added in v0.14.0

func (t NumberType) ValueType(_ context.Context) attr.Value

ValueType returns the Value type.

type NumberTypeWithSemanticEquals added in v1.3.0

type NumberTypeWithSemanticEquals struct {
	basetypes.NumberType

	SemanticEquals            bool
	SemanticEqualsDiagnostics diag.Diagnostics
}

NumberTypeWithSemanticEquals is a NumberType associated with NumberValueWithSemanticEquals, which implements semantic equality logic that returns the SemanticEquals boolean for testing.

func (NumberTypeWithSemanticEquals) Equal added in v1.3.0

func (NumberTypeWithSemanticEquals) String added in v1.3.0

func (NumberTypeWithSemanticEquals) ValueFromNumber added in v1.3.0

func (NumberTypeWithSemanticEquals) ValueFromTerraform added in v1.3.0

func (t NumberTypeWithSemanticEquals) ValueFromTerraform(ctx context.Context, in tftypes.Value) (attr.Value, error)

func (NumberTypeWithSemanticEquals) ValueType added in v1.3.0

type NumberTypeWithValidateError

type NumberTypeWithValidateError struct {
	NumberType
}

func (NumberTypeWithValidateError) Validate

func (NumberTypeWithValidateError) ValueFromTerraform

func (n NumberTypeWithValidateError) ValueFromTerraform(ctx context.Context, in tftypes.Value) (attr.Value, error)

type NumberTypeWithValidateWarning

type NumberTypeWithValidateWarning struct {
	NumberType
}

func (NumberTypeWithValidateWarning) Validate

func (NumberTypeWithValidateWarning) ValueFromTerraform

func (n NumberTypeWithValidateWarning) ValueFromTerraform(ctx context.Context, in tftypes.Value) (attr.Value, error)

type NumberValueWithSemanticEquals added in v1.3.0

type NumberValueWithSemanticEquals struct {
	basetypes.NumberValue

	SemanticEquals            bool
	SemanticEqualsDiagnostics diag.Diagnostics
}

func (NumberValueWithSemanticEquals) Equal added in v1.3.0

func (NumberValueWithSemanticEquals) NumberSemanticEquals added in v1.3.0

func (NumberValueWithSemanticEquals) Type added in v1.3.0

type ObjectType added in v1.3.0

type ObjectType struct {
	basetypes.ObjectType
}

type ObjectTypeWithSemanticEquals added in v1.3.0

type ObjectTypeWithSemanticEquals struct {
	basetypes.ObjectType

	SemanticEquals            bool
	SemanticEqualsDiagnostics diag.Diagnostics
}

ObjectTypeWithSemanticEquals is a ObjectType associated with ObjectValueWithSemanticEquals, which implements semantic equality logic that returns the SemanticEquals boolean for testing.

func (ObjectTypeWithSemanticEquals) Equal added in v1.3.0

func (ObjectTypeWithSemanticEquals) String added in v1.3.0

func (ObjectTypeWithSemanticEquals) ValueFromObject added in v1.3.0

func (ObjectTypeWithSemanticEquals) ValueFromTerraform added in v1.3.0

func (t ObjectTypeWithSemanticEquals) ValueFromTerraform(ctx context.Context, in tftypes.Value) (attr.Value, error)

func (ObjectTypeWithSemanticEquals) ValueType added in v1.3.0

type ObjectValue added in v1.3.0

type ObjectValue struct {
	basetypes.ObjectValue
}

type ObjectValueWithSemanticEquals added in v1.3.0

type ObjectValueWithSemanticEquals struct {
	basetypes.ObjectValue

	SemanticEquals            bool
	SemanticEqualsDiagnostics diag.Diagnostics
}

func (ObjectValueWithSemanticEquals) Equal added in v1.3.0

func (ObjectValueWithSemanticEquals) ObjectSemanticEquals added in v1.3.0

func (ObjectValueWithSemanticEquals) Type added in v1.3.0

type SetNestedAttributesCustomTypeType added in v0.16.0

type SetNestedAttributesCustomTypeType struct {
	types.SetType
}

func (SetNestedAttributesCustomTypeType) ValueFromTerraform added in v0.16.0

func (tt SetNestedAttributesCustomTypeType) ValueFromTerraform(ctx context.Context, value tftypes.Value) (attr.Value, error)

type SetNestedAttributesCustomValue added in v0.16.0

type SetNestedAttributesCustomValue struct {
	types.Set
}

type SetType added in v1.3.0

type SetType struct {
	basetypes.SetType
}

type SetTypeWithSemanticEquals added in v1.3.0

type SetTypeWithSemanticEquals struct {
	basetypes.SetType

	SemanticEquals            bool
	SemanticEqualsDiagnostics diag.Diagnostics
}

SetTypeWithSemanticEquals is a SetType associated with SetValueWithSemanticEquals, which implements semantic equality logic that returns the SemanticEquals boolean for testing.

func (SetTypeWithSemanticEquals) Equal added in v1.3.0

func (SetTypeWithSemanticEquals) String added in v1.3.0

func (t SetTypeWithSemanticEquals) String() string

func (SetTypeWithSemanticEquals) ValueFromSet added in v1.3.0

func (SetTypeWithSemanticEquals) ValueFromTerraform added in v1.3.0

func (t SetTypeWithSemanticEquals) ValueFromTerraform(ctx context.Context, in tftypes.Value) (attr.Value, error)

func (SetTypeWithSemanticEquals) ValueType added in v1.3.0

type SetTypeWithValidateError added in v0.4.0

type SetTypeWithValidateError struct {
	types.SetType
}

func (SetTypeWithValidateError) Validate added in v0.4.0

type SetTypeWithValidateWarning added in v0.4.0

type SetTypeWithValidateWarning struct {
	types.SetType
}

func (SetTypeWithValidateWarning) Validate added in v0.4.0

type SetValue added in v1.3.0

type SetValue struct {
	basetypes.SetValue
}

type SetValueWithSemanticEquals added in v1.3.0

type SetValueWithSemanticEquals struct {
	basetypes.SetValue

	SemanticEquals            bool
	SemanticEqualsDiagnostics diag.Diagnostics
}

func (SetValueWithSemanticEquals) Equal added in v1.3.0

func (SetValueWithSemanticEquals) SetSemanticEquals added in v1.3.0

func (SetValueWithSemanticEquals) Type added in v1.3.0

type SingleNestedAttributesCustomTypeType added in v0.16.0

type SingleNestedAttributesCustomTypeType struct {
	types.ObjectType
}

func (SingleNestedAttributesCustomTypeType) ValueFromTerraform added in v0.16.0

func (tt SingleNestedAttributesCustomTypeType) ValueFromTerraform(ctx context.Context, value tftypes.Value) (attr.Value, error)

type SingleNestedAttributesCustomValue added in v0.16.0

type SingleNestedAttributesCustomValue struct {
	types.Object
}

type String

type String struct {
	InternalString types.String

	CreatedBy attr.Type
}

func (String) Equal

func (s String) Equal(o attr.Value) bool

func (String) IsNull added in v0.9.0

func (s String) IsNull() bool

func (String) IsUnknown added in v0.9.0

func (s String) IsUnknown() bool

func (String) String added in v0.9.0

func (s String) String() string

func (String) ToStringValue added in v0.17.0

func (s String) ToStringValue(ctx context.Context) (types.String, diag.Diagnostics)

func (String) ToTerraformValue added in v0.9.0

func (s String) ToTerraformValue(ctx context.Context) (tftypes.Value, error)

func (String) Type

func (s String) Type(_ context.Context) attr.Type

type StringType

type StringType struct{}

StringType is a reimplementation of types.StringType that can be used as a base for other extension types in testing.

func (StringType) ApplyTerraform5AttributePathStep

func (t StringType) ApplyTerraform5AttributePathStep(step tftypes.AttributePathStep) (interface{}, error)

func (StringType) Equal

func (t StringType) Equal(o attr.Type) bool

func (StringType) String

func (t StringType) String() string

func (StringType) TerraformType

func (t StringType) TerraformType(_ context.Context) tftypes.Type

func (StringType) ValueFromString added in v0.17.0

func (StringType) ValueFromTerraform

func (t StringType) ValueFromTerraform(ctx context.Context, in tftypes.Value) (attr.Value, error)

func (StringType) ValueType added in v0.14.0

func (t StringType) ValueType(_ context.Context) attr.Value

ValueType returns the Value type.

type StringTypeWithSemanticEquals added in v1.3.0

type StringTypeWithSemanticEquals struct {
	basetypes.StringType

	SemanticEquals            bool
	SemanticEqualsDiagnostics diag.Diagnostics
}

StringTypeWithSemanticEquals is a StringType associated with StringValueWithSemanticEquals, which implements semantic equality logic that returns the SemanticEquals boolean for testing.

func (StringTypeWithSemanticEquals) Equal added in v1.3.0

func (StringTypeWithSemanticEquals) String added in v1.3.0

func (StringTypeWithSemanticEquals) ValueFromString added in v1.3.0

func (StringTypeWithSemanticEquals) ValueFromTerraform added in v1.3.0

func (t StringTypeWithSemanticEquals) ValueFromTerraform(ctx context.Context, in tftypes.Value) (attr.Value, error)

func (StringTypeWithSemanticEquals) ValueType added in v1.3.0

type StringTypeWithValidateError

type StringTypeWithValidateError struct {
	StringType
}

func (StringTypeWithValidateError) Equal

func (StringTypeWithValidateError) Validate

func (StringTypeWithValidateError) ValueFromTerraform

func (s StringTypeWithValidateError) ValueFromTerraform(ctx context.Context, in tftypes.Value) (attr.Value, error)

type StringTypeWithValidateWarning

type StringTypeWithValidateWarning struct {
	StringType
}

func (StringTypeWithValidateWarning) Equal

func (StringTypeWithValidateWarning) Validate

func (StringTypeWithValidateWarning) ValueFromTerraform

func (s StringTypeWithValidateWarning) ValueFromTerraform(ctx context.Context, in tftypes.Value) (attr.Value, error)

type StringValueWithSemanticEquals added in v1.3.0

type StringValueWithSemanticEquals struct {
	basetypes.StringValue

	SemanticEquals            bool
	SemanticEqualsDiagnostics diag.Diagnostics
}

func (StringValueWithSemanticEquals) Equal added in v1.3.0

func (StringValueWithSemanticEquals) StringSemanticEquals added in v1.3.0

func (StringValueWithSemanticEquals) Type added in v1.3.0

Jump to

Keyboard shortcuts

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