types

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2025 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const ProviderErrorDetailPrefix = "An unexpected error was encountered trying to validate an attribute value. " +
	"This is always an error in the provider. Please report the following to the provider developer:\n\n"

ProviderErrorDetailPrefix contains instructions for reporting provider errors to provider developers

Variables

View Source
var (
	DurationType = durationType{}
)

Functions

func EmptyAttributes

func EmptyAttributes(ctx context.Context, attributeTypes map[string]attr.Type) (map[string]attr.Value, diag.Diagnostics)

EmptyObject returns "empty" attributes (all values set to null) for the given attribute types.

func EmptyObject

func EmptyObject(ctx context.Context, attributeTypes map[string]attr.Type) (types.Object, diag.Diagnostics)

EmptyObject returns an "empty" object (one with all attributes set to null) for the given attribute types.

func NullValueForType

func NullValueForType(ctx context.Context, attrType attr.Type) (attr.Value, error)

NullValueForType returns a null attr.Value for the specified attr.Type.

Types

type Duration

type Duration struct {
	basetypes.StringValue
	// contains filtered or unexported fields
}

func DurationNull

func DurationNull() Duration

func DurationUnknown

func DurationUnknown() Duration

func DurationValue

func DurationValue(value string) Duration

DurationValue initializes a new Duration type with the provided value

This function does not return diagnostics, and therefore invalid duration values are not handled during construction. Invalid values will be detected by the ValidateAttribute method, called by the ValidateResourceConfig RPC during operations like `terraform validate`, `plan`, or `apply`.

func (Duration) Equal

func (v Duration) Equal(o attr.Value) bool

func (Duration) Type

func (Duration) ValidateAttribute

func (Duration) ValueDuration

func (v Duration) ValueDuration() time.Duration

ValueDuration returns the known time.Duration value. If Duration is null or unknown, returns 0.

Jump to

Keyboard shortcuts

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