fwprovider

package
v1.0.1 Latest Latest
Warning

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

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

Documentation

Overview

TODO: Move this to a shared 'types' package.

Index

Constants

View Source
const (
	DurationType durationType = iota
)

Variables

This section is empty.

Functions

func New

func New(primary interface{ Meta() interface{} }) tfsdk.Provider

New returns a new, initialized Terraform Plugin Framework-style provider instance. The provider instance is fully configured once the `Configure` method has been called.

Types

type Duration

type Duration struct {
	// Unknown will be true if the value is not yet known.
	Unknown bool

	// Null will be true if the value was not set, or was explicitly set to
	// null.
	Null bool

	// Value contains the set value, as long as Unknown and Null are both
	// false.
	Value time.Duration
}

func (Duration) Equal

func (d Duration) Equal(other attr.Value) bool

Equal returns true if `other` is a *Duration and has the same value as `d`.

func (Duration) IsNull

func (d Duration) IsNull() bool

IsNull returns true if the Value is not set, or is explicitly set to null.

func (Duration) IsUnknown

func (d Duration) IsUnknown() bool

IsUnknown returns true if the Value is not yet known.

func (Duration) String

func (d Duration) String() string

String returns a summary representation of either the underlying Value, or UnknownValueString (`<unknown>`) when IsUnknown() returns true, or NullValueString (`<null>`) when IsNull() return true.

This is an intentionally lossy representation, that are best suited for logging and error reporting, as they are not protected by compatibility guarantees within the framework.

func (Duration) ToTerraformValue

func (d Duration) ToTerraformValue(ctx context.Context) (tftypes.Value, error)

ToTerraformValue returns the data contained in the *String as a string. If Unknown is true, it returns a tftypes.UnknownValue. If Null is true, it returns nil.

func (Duration) Type

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

Type returns a DurationType.

Jump to

Keyboard shortcuts

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