Documentation ¶
Index ¶
- Variables
- func DebugClientRequest(s string, v ...interface{})
- func DoClientRequest(settings *ClientSettings, method string, path string, body *bytes.Buffer, ...) (*http.Response, error)
- func GetClientRequestObject(settings *ClientSettings, method string, path string, body io.Reader) (*http.Request, error)
- type ClientSettings
- type CustomBool
- type CustomInt
- type DiskBody
- type DiskCreateBody
- type DiskListBody
- type ErrorBody
- type FirewallRuleBody
- type FirewallRuleCreateBody
- type FirewallRuleListBody
- type IPAddressBody
- type IPAddressListBody
- type LocationBody
- type LocationListBody
- type LogsBody
- type LogsListBody
- type NetworkInterfaceBody
- type NetworkInterfaceListBody
- type NetworkInterfaceUpdateBody
- type PackageBody
- type PackageeListBody
- type ServerBody
- type ServerCreateBody
- type ServerListBody
- type ServerUpdateBody
- type ServerUpgradeBody
- type TemplateBody
- type TemplateListBody
Constants ¶
This section is empty.
Variables ¶
var ( // EnableDebugMessages sets whether or not to write debug messages to the log. EnableDebugMessages = false )
Functions ¶
func DebugClientRequest ¶
func DebugClientRequest(s string, v ...interface{})
DebugClientRequest writes a message to the log.
func DoClientRequest ¶
func DoClientRequest(settings *ClientSettings, method string, path string, body *bytes.Buffer, successCodes []int, retryLimit int, retryDelay int) (*http.Response, error)
DoClientRequest performs a HTTP request and does so multiple times, if required.
func GetClientRequestObject ¶
func GetClientRequestObject(settings *ClientSettings, method string, path string, body io.Reader) (*http.Request, error)
GetClientRequestObject returns a new HTTP request object.
Types ¶
type ClientSettings ¶
ClientSettings describes the client settings.
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) UnmarshalJSON ¶
func (r *CustomBool) 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 DiskBody ¶
type DiskBody struct { Identifier string `json:"identifier"` Label string `json:"label"` Size CustomInt `json:"size"` Primary CustomBool `json:"primary"` }
DiskBody describes a disk object.
type DiskCreateBody ¶
DiskCreateBody describes a disk creation object.
type FirewallRuleBody ¶
type FirewallRuleBody struct { Identifier string `json:"identifier"` Position CustomInt `json:"position"` Command string `json:"command"` Protocol string `json:"protocol"` Address string `json:"address"` Bits CustomInt `json:"bits"` Port string `json:"port"` }
FirewallRuleBody describes a firewall rule object.
type FirewallRuleCreateBody ¶
type FirewallRuleCreateBody struct { Command string `json:"command"` Protocol string `json:"protocol"` Address string `json:"address"` Bits CustomInt `json:"bits"` Port string `json:"port"` }
FirewallRuleCreateBody describes a firewall rule creation object.
type FirewallRuleListBody ¶
type FirewallRuleListBody []FirewallRuleBody
FirewallRuleListBody describes a firewall rule list.
type IPAddressBody ¶
type IPAddressBody struct { Address string `json:"address"` Network string `json:"network"` Netmask string `json:"netmask"` Gateway string `json:"gateway"` NetworkInterfaceIdentifier string `json:"network_interface_identifier"` }
IPAddressBody describes an IP address object.
type IPAddressListBody ¶
type IPAddressListBody []IPAddressBody
IPAddressListBody describes an IP address list.
type LocationBody ¶
LocationBody describes a datacenter location object.
type LocationListBody ¶
type LocationListBody []LocationBody
LocationListBody describes a datacenter location list.
type LogsBody ¶
type LogsBody struct { Identifier CustomInt `json:"id"` Action string `json:"action"` Status string `json:"status"` TargetType string `json:"target_type"` TargetIdentifier CustomInt `json:"target_id"` CreatedAt string `json:"created_at"` }
LogsBody describes a logs object.
type NetworkInterfaceBody ¶
type NetworkInterfaceBody struct { Identifier string `json:"identifier"` Label string `json:"label"` RateLimit CustomInt `json:"rate_limit"` DefaultFirewallRule string `json:"default_firewall_rule"` Primary CustomBool `json:"primary"` IPAddresses IPAddressListBody `json:"ipAddresses"` FirewallRules FirewallRuleListBody `json:"firewallRules"` }
NetworkInterfaceBody describes a network interface object.
type NetworkInterfaceListBody ¶
type NetworkInterfaceListBody []NetworkInterfaceBody
NetworkInterfaceListBody describes a network interface list.
type NetworkInterfaceUpdateBody ¶
type NetworkInterfaceUpdateBody struct { Label string `json:"label"` DefaultFirewallRule string `json:"default_firewall_rule"` }
NetworkInterfaceUpdateBody describes a network interface update object.
type PackageBody ¶
PackageBody describes a server package object.
type PackageeListBody ¶
type PackageeListBody []PackageBody
PackageeListBody describes a server package list.
type ServerBody ¶
type ServerBody struct { Identifier string `json:"identifier"` Hostname string `json:"hostname"` Label string `json:"label"` CPUs CustomInt `json:"cpus"` Memory CustomInt `json:"memory"` Booted CustomBool `json:"booted"` Disks DiskListBody `json:"disks"` NetworkInterfaces NetworkInterfaceListBody `json:"networkInterfaces"` Template TemplateBody `json:"template"` Location LocationBody `json:"location"` Package PackageBody `json:"package"` }
ServerBody describes a server object.
type ServerCreateBody ¶
type ServerCreateBody struct { Hostname string `json:"hostname"` Label string `json:"label"` InitialRootPassword string `json:"initialRootPassword"` Package string `json:"package"` Template string `json:"template"` Location string `json:"location"` }
ServerCreateBody describes a server creation object.
type ServerUpdateBody ¶
ServerUpdateBody describes a server update object.
type ServerUpgradeBody ¶
type ServerUpgradeBody struct { Package string `json:"package"` UpgradeDisk CustomBool `json:"upgradeDisk"` }
ServerUpgradeBody describes a server upgrade object.
type TemplateBody ¶
TemplateBody describes a datacenter location object.
type TemplateListBody ¶
type TemplateListBody []TemplateBody
TemplateListBody describes a datacenter location list.