Documentation ¶
Index ¶
- func FormatDiskSize(size DiskSize) string
- func StrPtr(s string) *string
- type CustomBool
- type CustomCommaSeparatedList
- type CustomInt
- type CustomLineBreakSeparatedList
- type CustomPrivileges
- type CustomTimestamp
- type DiskSize
- type IPAddrType
- func (t IPAddrType) Equal(o attr.Type) bool
- func (t IPAddrType) String() string
- func (t IPAddrType) Validate(_ context.Context, value tftypes.Value, valuePath path.Path) diag.Diagnostics
- func (t IPAddrType) ValueFromString(_ context.Context, in basetypes.StringValue) (basetypes.StringValuable, diag.Diagnostics)
- func (t IPAddrType) ValueFromTerraform(ctx context.Context, in tftypes.Value) (attr.Value, error)
- func (t IPAddrType) ValueType(_ context.Context) attr.Value
- type IPAddrValue
- type IPCIDRType
- func (t IPCIDRType) Equal(o attr.Type) bool
- func (t IPCIDRType) String() string
- func (t IPCIDRType) Validate(_ context.Context, value tftypes.Value, valuePath path.Path) diag.Diagnostics
- func (t IPCIDRType) ValueFromString(_ context.Context, in basetypes.StringValue) (basetypes.StringValuable, diag.Diagnostics)
- func (t IPCIDRType) ValueFromTerraform(ctx context.Context, in tftypes.Value) (attr.Value, error)
- func (t IPCIDRType) ValueType(_ context.Context) attr.Value
- type IPCIDRValue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatDiskSize ¶ added in v0.24.0
FormatDiskSize turns a number of bytes into a disk size string.
Types ¶
type CustomBool ¶
type CustomBool bool
CustomBool allows a JSON boolean value to also be an integer.
func BoolPtr ¶ added in v0.24.0
func BoolPtr(s bool) *CustomBool
BoolPtr returns a pointer to a bool.
func (CustomBool) MarshalJSON ¶
func (r CustomBool) MarshalJSON() ([]byte, error)
MarshalJSON converts a boolean to a JSON value.
func (*CustomBool) PointerBool ¶
func (r *CustomBool) PointerBool() *bool
PointerBool returns a pointer to a boolean.
func (*CustomBool) UnmarshalJSON ¶
func (r *CustomBool) UnmarshalJSON(b []byte) error
UnmarshalJSON converts a JSON value to a boolean.
type CustomCommaSeparatedList ¶
type CustomCommaSeparatedList []string
CustomCommaSeparatedList allows a JSON string to also be a string array.
func (*CustomCommaSeparatedList) MarshalJSON ¶
func (r *CustomCommaSeparatedList) MarshalJSON() ([]byte, error)
MarshalJSON converts a boolean to a JSON value.
func (*CustomCommaSeparatedList) UnmarshalJSON ¶
func (r *CustomCommaSeparatedList) UnmarshalJSON(b []byte) error
UnmarshalJSON converts a JSON value to a boolean.
type CustomInt ¶
type CustomInt int
CustomInt allows a JSON integer value to also be a string.
func (*CustomInt) UnmarshalJSON ¶
UnmarshalJSON converts a JSON value to an integer.
type CustomLineBreakSeparatedList ¶
type CustomLineBreakSeparatedList []string
CustomLineBreakSeparatedList allows a multiline JSON string to also be a string array.
func (*CustomLineBreakSeparatedList) MarshalJSON ¶
func (r *CustomLineBreakSeparatedList) MarshalJSON() ([]byte, error)
MarshalJSON converts a boolean to a JSON value.
func (*CustomLineBreakSeparatedList) UnmarshalJSON ¶
func (r *CustomLineBreakSeparatedList) UnmarshalJSON(b []byte) error
UnmarshalJSON converts a JSON value to a boolean.
type CustomPrivileges ¶
type CustomPrivileges []string
CustomPrivileges allows a JSON object of privileges to also be a string array.
func (*CustomPrivileges) MarshalJSON ¶
func (r *CustomPrivileges) MarshalJSON() ([]byte, error)
MarshalJSON converts a boolean to a JSON value.
func (*CustomPrivileges) UnmarshalJSON ¶
func (r *CustomPrivileges) UnmarshalJSON(b []byte) error
UnmarshalJSON converts a JSON value to a boolean.
type CustomTimestamp ¶
CustomTimestamp allows a JSON boolean value to also be a unix timestamp.
func (CustomTimestamp) MarshalJSON ¶
func (r CustomTimestamp) MarshalJSON() ([]byte, error)
MarshalJSON converts a timestamp to a JSON value.
func (*CustomTimestamp) UnmarshalJSON ¶
func (r *CustomTimestamp) UnmarshalJSON(b []byte) error
UnmarshalJSON converts a JSON value to a timestamp.
type DiskSize ¶ added in v0.24.0
type DiskSize int64
DiskSize allows a JSON integer value to also be a string. This is mapped to `<DiskSize>` data type in Proxmox API. Represents a disk size in bytes.
func DiskSizeFromGigabytes ¶ added in v0.24.0
DiskSizeFromGigabytes creates a DiskSize from gigabytes.
func ParseDiskSize ¶ added in v0.24.0
ParseDiskSize parses a disk size string into a number of bytes.
func (DiskSize) InGigabytes ¶ added in v0.24.0
InGigabytes returns the disk size in gigabytes.
func (DiskSize) InMegabytes ¶ added in v0.24.0
InMegabytes returns the disk size in megabytes.
func (DiskSize) MarshalJSON ¶ added in v0.24.0
MarshalJSON marshals a disk size into a Proxmox API `<DiskSize>` string.
func (DiskSize) String ¶ added in v0.24.0
String returns the string representation of the disk size.
func (*DiskSize) UnmarshalJSON ¶ added in v0.24.0
UnmarshalJSON unmarshals a disk size from a Proxmox API `<DiskSize>` string.
type IPAddrType ¶
type IPAddrType struct {
basetypes.StringType
}
IPAddrType is a type that represents an IP address.
func (IPAddrType) Equal ¶
func (t IPAddrType) Equal(o attr.Type) bool
Equal returns true if the two types are equal.
func (IPAddrType) String ¶
func (t IPAddrType) String() string
String returns a string representation of the type.
func (IPAddrType) Validate ¶
func (t IPAddrType) Validate(_ context.Context, value tftypes.Value, valuePath path.Path) diag.Diagnostics
Validate ensures the value is valid IP address.
func (IPAddrType) ValueFromString ¶
func (t IPAddrType) ValueFromString( _ context.Context, in basetypes.StringValue, ) (basetypes.StringValuable, diag.Diagnostics)
ValueFromString converts a string value to a StringValuable.
func (IPAddrType) ValueFromTerraform ¶
ValueFromTerraform converts a Terraform value to a StringValuable.
type IPAddrValue ¶
type IPAddrValue struct {
basetypes.StringValue
}
IPAddrValue is a type that represents an IP address value.
func NewIPAddrPointerValue ¶
func NewIPAddrPointerValue(value *string) IPAddrValue
NewIPAddrPointerValue returns a new IPAddrValue from a string pointer.
type IPCIDRType ¶
type IPCIDRType struct {
basetypes.StringType
}
IPCIDRType is a type that represents an IP address in CIDR notation.
func (IPCIDRType) Equal ¶
func (t IPCIDRType) Equal(o attr.Type) bool
Equal returns true if the two types are equal.
func (IPCIDRType) String ¶
func (t IPCIDRType) String() string
String returns a string representation of the type.
func (IPCIDRType) Validate ¶
func (t IPCIDRType) Validate(_ context.Context, value tftypes.Value, valuePath path.Path) diag.Diagnostics
Validate ensures the value is valid IP address in CIDR notation.
func (IPCIDRType) ValueFromString ¶
func (t IPCIDRType) ValueFromString( _ context.Context, in basetypes.StringValue, ) (basetypes.StringValuable, diag.Diagnostics)
ValueFromString converts a string value to a StringValuable.
func (IPCIDRType) ValueFromTerraform ¶
ValueFromTerraform converts a Terraform value to a StringValuable.
type IPCIDRValue ¶
type IPCIDRValue struct {
basetypes.StringValue
}
IPCIDRValue is a type that represents an IP address in CIDR notation.
func NewIPCIDRPointerValue ¶
func NewIPCIDRPointerValue(value *string) IPCIDRValue
NewIPCIDRPointerValue returns a new IPCIDRValue from a string pointer.