customtypes

package
v0.11.15 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Duration

type Duration struct {
	basetypes.StringValue
}

func NewDurationNull

func NewDurationNull() Duration

NewDurationNull creates a Duration with a null value. Determine whether the value is null via IsNull method.

func NewDurationPointerValue

func NewDurationPointerValue(value *string) Duration

NewDurationPointerValue creates a Duration with a null value if nil or a known value. Access the value via ValueStringPointer method.

func NewDurationUnknown

func NewDurationUnknown() Duration

NewDurationUnknown creates a Duration with an unknown value. Determine whether the value is unknown via IsUnknown method.

func NewDurationValue

func NewDurationValue(value string) Duration

NewDurationValue creates a Duration with a known value. Access the value via ValueString method.

func (Duration) Equal

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

Equal returns true if the given value is equivalent.

func (Duration) Parse

func (v Duration) Parse() (time.Duration, diag.Diagnostics)

Parse calls time.ParseDuration with the Duration StringValue. A null or unknown value will produce an error diagnostic.

func (Duration) StringSemanticEquals

func (v Duration) StringSemanticEquals(_ context.Context, newValuable basetypes.StringValuable) (bool, diag.Diagnostics)

StringSemanticEquals returns true if the given duration string value is semantically equal to the current duration string value. When compared, the durations are parsed into a time.Duration and the underlying nanosecond values compared.

func (Duration) Type

func (v Duration) Type(_ context.Context) attr.Type

Type returns a DurationType.

func (Duration) ValidateAttribute

type DurationType

type DurationType struct {
	basetypes.StringType
}

func (DurationType) Equal

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

Equal returns true if the given type is equivalent.

func (DurationType) String

func (t DurationType) String() string

String returns a human readable string of the type name.

func (DurationType) ValueFromString

ValueFromString returns a StringValuable type given a StringValue.

func (DurationType) ValueFromTerraform

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

ValueFromTerraform returns a Value given a tftypes.Value. This is meant to convert the tftypes.Value into a more convenient Go type for the provider to consume the data with.

func (DurationType) ValueType

func (t DurationType) ValueType(ctx context.Context) attr.Value

ValueType returns the Value type.

Jump to

Keyboard shortcuts

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