types

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2022 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 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 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 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 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 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 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 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 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 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 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 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)

Jump to

Keyboard shortcuts

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