Documentation
¶
Index ¶
- func Attributes(ctx context.Context) schema.Attribute
- func AttributesWithOpts(ctx context.Context, opts Opts) schema.Attribute
- func Block(ctx context.Context) schema.Block
- func BlockWithOpts(ctx context.Context, opts Opts) schema.Block
- type Opts
- type Type
- func (t Type) Equal(candidate attr.Type) bool
- func (t Type) String() string
- func (t Type) ValueFromObject(_ context.Context, in basetypes.ObjectValue) (basetypes.ObjectValuable, diag.Diagnostics)
- func (t Type) ValueFromTerraform(ctx context.Context, in tftypes.Value) (attr.Value, error)
- func (t Type) ValueType(context.Context) attr.Value
- type Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Attributes ¶
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
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 ¶
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
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 ¶
Equal returns true if `candidate` is also a Type and has the same AttributeTypes.
func (Type) ValueFromObject ¶ added in v0.4.1
func (t Type) ValueFromObject(_ context.Context, in basetypes.ObjectValue) (basetypes.ObjectValuable, diag.Diagnostics)
ValueFromObject returns a Value given a basetypes.ObjectValue.
func (Type) ValueFromTerraform ¶
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.
type Value ¶
Value represents an object containing values to be used as time.Duration for timeouts.
func (Value) Equal ¶
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.