Documentation ¶
Overview ¶
package timetypes implements a terraform-plugin-framework attr.Type and attr.Value for RFC 3339 timestamp strings.
Index ¶
- type RFC3339
- func (v RFC3339) Equal(o attr.Value) bool
- func (v RFC3339) IsNull() bool
- func (v RFC3339) IsUnknown() bool
- func (v RFC3339) String() string
- func (v RFC3339) Time() time.Time
- func (v RFC3339) ToTerraformValue(_ context.Context) (tftypes.Value, error)
- func (v RFC3339) Type(_ context.Context) attr.Type
- type RFC3339Type
- func (t RFC3339Type) ApplyTerraform5AttributePathStep(step tftypes.AttributePathStep) (any, error)
- func (t RFC3339Type) Equal(o attr.Type) bool
- func (t RFC3339Type) String() string
- func (t RFC3339Type) TerraformType(_ context.Context) tftypes.Type
- func (t RFC3339Type) Validate(_ context.Context, terraformValue tftypes.Value, schemaPath path.Path) diag.Diagnostics
- func (t RFC3339Type) ValueFromTerraform(_ context.Context, terraformValue tftypes.Value) (attr.Value, error)
- func (t RFC3339Type) ValueType(_ context.Context) attr.Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RFC3339 ¶ added in v0.2.1
type RFC3339 struct {
// contains filtered or unexported fields
}
RFC3339 implements the attr.Value interface for usage in logic.
func RFC3339String ¶
RFC3339String returns a known RFC3339 or any errors while attempting to parse the string as RFC 3339 format.
func RFC3339Time ¶
RFC3339Time returns a known RFC3339 with the given time.
func (RFC3339) Equal ¶ added in v0.2.1
Equal returns true if the given attr.Value matches the following:
- Is a RFC3339 type
- Has the same null, unknown, and value data
func (RFC3339) IsUnknown ¶ added in v0.2.1
IsUnknown returns true if the RFC3339 represents an unknown Value.
func (RFC3339) ToTerraformValue ¶ added in v0.2.1
ToTerraformValue converts the RFC3339 to a tftypes.String.
type RFC3339Type ¶
type RFC3339Type struct{}
RFC3339Type implements the attr.Type interface for usage in schema definitions and data models.
func (RFC3339Type) ApplyTerraform5AttributePathStep ¶
func (t RFC3339Type) ApplyTerraform5AttributePathStep(step tftypes.AttributePathStep) (any, error)
ApplyTerraform5AttributePathStep always returns an error as this type cannot be walked any further.
func (RFC3339Type) Equal ¶
func (t RFC3339Type) Equal(o attr.Type) bool
Equal returns true if the given type is Type.
func (RFC3339Type) String ¶
func (t RFC3339Type) String() string
String returns a human readable string of the type.
func (RFC3339Type) TerraformType ¶
func (t RFC3339Type) TerraformType(_ context.Context) tftypes.Type
TerraformType always returns tftypes.String.
func (RFC3339Type) Validate ¶
func (t RFC3339Type) Validate(_ context.Context, terraformValue tftypes.Value, schemaPath path.Path) diag.Diagnostics
Validate ensures the value is always RFC 3339 conformant.
func (RFC3339Type) ValueFromTerraform ¶
func (t RFC3339Type) ValueFromTerraform(_ context.Context, terraformValue tftypes.Value) (attr.Value, error)
ValueFromTerraform converts the tftypes.Value into a value.