timeouts

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2022 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Attributes

func Attributes(ctx context.Context, opts Opts) tfsdk.Attribute

Attributes returns a tfsdk.Attribute containing a tfsdk.SingleNestedAttributes which contains attributes for each of the fields in Opts which are set to true. Each attribute 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 AttributesAll

func AttributesAll(ctx context.Context) tfsdk.Attribute

AttributesAll returns a tfsdk.Attribute containing a tfsdk.SingleNestedAttributes which contains attributes for each of create, read, update and delete. Each attribute 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 Block

func Block(ctx context.Context, opts Opts) tfsdk.Block

Block returns a tfsdk.Block containing attributes for each of the fields in Opts which are set to true. Each attribute 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 BlockAll

func BlockAll(ctx context.Context) tfsdk.Block

BlockAll returns a tfsdk.Block containing attributes for each of create, read, update and delete. Each attribute 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 Create

func Create(ctx context.Context, obj types.Object, def time.Duration) time.Duration

Create interrogates the supplied types.Object and if the object.Attrs contains an entry for "create" that can be parsed then time.Duration is returned. If object.Attrs does not contain "create" the supplied default will be returned.

func Delete

func Delete(ctx context.Context, obj types.Object, def time.Duration) time.Duration

Delete interrogates the supplied types.Object and if the object.Attrs contains an entry for "delete" that can be parsed then time.Duration is returned. If object.Attrs does not contain "delete" the supplied default will be returned.

func Read

func Read(ctx context.Context, obj types.Object, def time.Duration) time.Duration

Read interrogates the supplied types.Object and if the object.Attrs contains an entry for "read" that can be parsed then time.Duration is returned. If object.Attrs does not contain "read" the supplied default will be returned.

func Update

func Update(ctx context.Context, obj types.Object, def time.Duration) time.Duration

Update interrogates the supplied types.Object and if the object.Attrs contains an entry for "update" that can be parsed then time.Duration is returned. If object.Attrs does not contain "update" the supplied default will be returned.

Types

type Opts

type Opts struct {
	Create bool
	Read   bool
	Update bool
	Delete bool
}

Opts is used as an argument to Block and Attributes to indicate which attributes should be created.

Jump to

Keyboard shortcuts

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