Documentation ¶
Index ¶
- type Mac
- func (v Mac) Equal(o attr.Value) bool
- func (v Mac) Type(_ context.Context) attr.Type
- func (v Mac) ValidateAttribute(ctx context.Context, req xattr.ValidateAttributeRequest, ...)
- func (v Mac) ValidateParameter(ctx context.Context, req function.ValidateParameterRequest, ...)
- func (v Mac) ValueMac() (net.HardwareAddr, diag.Diagnostics)
- type MacType
- func (t MacType) Equal(o attr.Type) bool
- func (t MacType) String() string
- func (t MacType) ValueFromString(ctx context.Context, in basetypes.StringValue) (basetypes.StringValuable, diag.Diagnostics)
- func (t MacType) ValueFromTerraform(ctx context.Context, in tftypes.Value) (attr.Value, error)
- func (t MacType) ValueType(ctx context.Context) attr.Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mac ¶
type Mac struct {
basetypes.StringValue
}
Mac represents a valid mac address.
func NewMacNull ¶
func NewMacNull() Mac
NewMacNull creates an Mac with a null value. Determine whether the value is null via IsNull method.
func NewMacPointerValue ¶
NewMacPointerValue creates an Mac with a null value if nil or a known value. Access the value via ValueStringPointer method.
func NewMacUnknown ¶
func NewMacUnknown() Mac
NewMacUnknown creates an Mac with an unknown value. Determine whether the value is unknown via IsUnknown method.
func NewMacValue ¶
NewMacValue creates an Mac with a known value. Access the value via ValueString method.
func (Mac) ValidateAttribute ¶
func (v Mac) ValidateAttribute(ctx context.Context, req xattr.ValidateAttributeRequest, resp *xattr.ValidateAttributeResponse)
ValidateAttribute implements attribute value validation. This type requires the value provided to be a String value that is a valid mac address.
func (Mac) ValidateParameter ¶
func (v Mac) ValidateParameter(ctx context.Context, req function.ValidateParameterRequest, resp *function.ValidateParameterResponse)
ValidateParameter implements provider-defined function parameter value validation. This type requires the value provided to be a String value that is a valid mac address.
func (Mac) ValueMac ¶
func (v Mac) ValueMac() (net.HardwareAddr, diag.Diagnostics)
ValueMac calls net.ParseMAC with the Mac StringValue. A null or unknown value will produce an error diagnostic.
type MacType ¶
type MacType struct {
basetypes.StringType
}
MacType is an attribute type that represents a valid mac address.
func (MacType) ValueFromString ¶
func (t MacType) ValueFromString(ctx context.Context, in basetypes.StringValue) (basetypes.StringValuable, diag.Diagnostics)
ValueFromString returns a StringValuable type given a StringValue.
func (MacType) ValueFromTerraform ¶
ValueFromTerraform returns a Value given a tftypes.Value. This is meant to convert the tftypes.Value into a more convenient Go type for the provider to consume the data with.