timetypes

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2022 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Overview

package timetypes implements a terraform-plugin-framework attr.Type and attr.Value for RFC 3339 timestamp strings.

Index

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 RFC3339Null

func RFC3339Null() RFC3339

RFC3339Null returns a null RFC3339.

func RFC3339String

func RFC3339String(s string, schemaPath path.Path) (RFC3339, diag.Diagnostics)

RFC3339String returns a known RFC3339 or any errors while attempting to parse the string as RFC 3339 format.

func RFC3339Time

func RFC3339Time(t time.Time) RFC3339

RFC3339Time returns a known RFC3339 with the given time.

func RFC3339Unknown

func RFC3339Unknown() RFC3339

RFC3339Unknown returns an unknown RFC3339.

func (RFC3339) Equal added in v0.2.1

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

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) IsNull added in v0.2.1

func (v RFC3339) IsNull() bool

IsNull returns true if the RFC3339 represents a null Value.

func (RFC3339) IsUnknown added in v0.2.1

func (v RFC3339) IsUnknown() bool

IsUnknown returns true if the RFC3339 represents an unknown Value.

func (RFC3339) String added in v0.2.1

func (v RFC3339) String() string

String returns a human readable string of the RFC3339.

func (RFC3339) Time added in v0.2.1

func (v RFC3339) Time() time.Time

Time returns the time.Time of a RFC3339.

func (RFC3339) ToTerraformValue added in v0.2.1

func (v RFC3339) ToTerraformValue(_ context.Context) (tftypes.Value, error)

ToTerraformValue converts the RFC3339 to a tftypes.String.

func (RFC3339) Type added in v0.2.1

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

Type returns the attr.Type of RFC3339.

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.

func (RFC3339Type) ValueType

func (t RFC3339Type) ValueType(_ context.Context) attr.Value

ValueType returns the associated attr.Value.

Jump to

Keyboard shortcuts

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