Documentation
¶
Index ¶
- type Duration
- func (v Duration) Equal(o attr.Value) bool
- func (v Duration) Parse() (time.Duration, diag.Diagnostics)
- func (v Duration) StringSemanticEquals(_ context.Context, newValuable basetypes.StringValuable) (bool, diag.Diagnostics)
- func (v Duration) Type(_ context.Context) attr.Type
- func (t Duration) ValidateAttribute(ctx context.Context, req xattr.ValidateAttributeRequest, ...)
- type DurationType
- func (t DurationType) Equal(o attr.Type) bool
- func (t DurationType) String() string
- func (t DurationType) ValueFromString(ctx context.Context, in basetypes.StringValue) (basetypes.StringValuable, diag.Diagnostics)
- func (t DurationType) ValueFromTerraform(ctx context.Context, in tftypes.Value) (attr.Value, error)
- func (t DurationType) ValueType(ctx context.Context) attr.Value
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 ¶
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 ¶
NewDurationValue creates a Duration with a known value. Access the value via ValueString method.
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) ValidateAttribute ¶
func (t Duration) ValidateAttribute(ctx context.Context, req xattr.ValidateAttributeRequest, resp *xattr.ValidateAttributeResponse)
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 ¶
func (t DurationType) ValueFromString(ctx context.Context, in basetypes.StringValue) (basetypes.StringValuable, diag.Diagnostics)
ValueFromString returns a StringValuable type given a StringValue.
func (DurationType) ValueFromTerraform ¶
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.