Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client interface { // DoRequest performs a request against the Proxmox API. DoRequest( ctx context.Context, method, path string, requestBody, responseBody interface{}, ) error // ExpandPath expands a path relative to the client's base path. // For example, if the client is configured for a VM and the // path is "firewall/options", the returned path will be // "/nodes/<node>/qemu/<vmid>/firewall/options". ExpandPath(path string) string }
type CustomBool ¶
type CustomBool bool
CustomBool allows a JSON boolean value to also be an integer.
func BoolPtr ¶ added in v0.19.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) 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.19.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.19.0
DiskSizeFromGigabytes creates a DiskSize from gigabytes.
func (DiskSize) InGigabytes ¶ added in v0.19.0
InGigabytes returns the disk size in gigabytes.
func (DiskSize) MarshalJSON ¶ added in v0.19.0
MarshalJSON marshals a disk size into a Proxmox API `<DiskSize>` string.
func (DiskSize) String ¶ added in v0.19.0
String returns the string representation of the disk size.
func (*DiskSize) UnmarshalJSON ¶ added in v0.19.0
UnmarshalJSON unmarshals a disk size from a Proxmox API `<DiskSize>` string.