timeouts

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2023 License: MPL-2.0 Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Attributes

func Attributes(ctx context.Context) schema.Attribute

Attributes returns a schema.SingleNestedAttribute which contains an attribute for `Read`, which is defined as types.StringType and optional. A validator is used to verify that the value assigned to an attribute can be parsed as time.Duration.

func AttributesWithOpts added in v0.4.0

func AttributesWithOpts(ctx context.Context, opts Opts) schema.Attribute

AttributesWithOpts returns a schema.SingleNestedAttribute which contains an attribute for `Read`, which is defined as types.StringType and optional. A validator is used to verify that the value assigned to an attribute can be parsed as time.Duration. The supplied Opts are used to override defaults.

func Block

func Block(ctx context.Context) schema.Block

Block returns a schema.Block containing attributes for `Read`, which is defined as types.StringType and optional. A validator is used to verify that the value assigned to `Read` can be parsed as time.Duration.

func BlockWithOpts added in v0.4.0

func BlockWithOpts(ctx context.Context, opts Opts) schema.Block

BlockWithOpts returns a schema.Block containing attributes for `Read`, which is defined as types.StringType and optional. A validator is used to verify that the value assigned to `Read` can be parsed as time.Duration. The supplied Opts are used to override defaults.

Types

type Opts added in v0.4.0

type Opts struct {
	ReadDescription string
}

Opts is used as an argument to BlockWithOpts and AttributesWithOpts to indicate whether supplied descriptions should override default descriptions.

type Type

type Type struct {
	basetypes.ObjectType
}

Type is an attribute type that represents timeouts.

func (Type) Equal

func (t Type) Equal(candidate attr.Type) bool

Equal returns true if `candidate` is also a Type and has the same AttributeTypes.

func (Type) String added in v0.4.1

func (t Type) String() string

String returns a human-readable representation of the type.

func (Type) ValueFromObject added in v0.4.1

ValueFromObject returns a Value given a basetypes.ObjectValue.

func (Type) ValueFromTerraform

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

ValueFromTerraform returns a Value given a tftypes.Value. Value embeds the types.Object value returned from calling ValueFromTerraform on the types.ObjectType embedded in Type.

func (Type) ValueType added in v0.4.1

func (t Type) ValueType(context.Context) attr.Value

ValueType returns the associated Value type for debugging.

type Value

type Value struct {
	types.Object
}

Value represents an object containing values to be used as time.Duration for timeouts.

func (Value) Equal

func (t Value) Equal(c attr.Value) bool

Equal returns true if the Value is considered semantically equal (same type and same value) to the attr.Value passed as an argument.

func (Value) Read

func (t Value) Read(ctx context.Context, defaultTimeout time.Duration) (time.Duration, diag.Diagnostics)

Read attempts to retrieve the "read" attribute and parse it as time.Duration. If any diagnostics are generated they are returned along with the supplied default timeout.

func (Value) ToObjectValue added in v0.4.1

func (v Value) ToObjectValue(_ context.Context) (basetypes.ObjectValue, diag.Diagnostics)

ToObjectValue returns the underlying ObjectValue.

func (Value) Type

func (t Value) Type(ctx context.Context) attr.Type

Type returns a Type with the same attribute types as `t`.

Jump to

Keyboard shortcuts

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