Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatDiskSize ¶
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 (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 ¶
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 ¶
DiskSizeFromGigabytes creates a DiskSize from gigabytes.
func ParseDiskSize ¶
ParseDiskSize parses a disk size string into a number of bytes.
func (DiskSize) InGigabytes ¶
InGigabytes returns the disk size in gigabytes.
func (DiskSize) InMegabytes ¶
InMegabytes returns the disk size in megabytes.
func (DiskSize) MarshalJSON ¶
MarshalJSON marshals a disk size into a Proxmox API `<DiskSize>` string.
func (*DiskSize) UnmarshalJSON ¶
UnmarshalJSON unmarshals a disk size from a Proxmox API `<DiskSize>` string.