Documentation ¶
Index ¶
- Constants
- func NewRequest(d DigitalOceanClient, path string, params string) (map[string]interface{}, error)
- type Artifact
- type Builder
- type DigitalOceanClient
- func (d DigitalOceanClient) CreateDroplet(name string, size uint, image uint, region uint, keyId uint) (uint, error)
- func (d DigitalOceanClient) CreateKey(name string, pub string) (uint, error)
- func (d DigitalOceanClient) CreateSnapshot(id uint, name string) error
- func (d DigitalOceanClient) DestroyDroplet(id uint) error
- func (d DigitalOceanClient) DestroyImage(id uint) error
- func (d DigitalOceanClient) DestroyKey(id uint) error
- func (d DigitalOceanClient) DropletStatus(id uint) (string, string, error)
- func (d DigitalOceanClient) Images() ([]Image, error)
- func (d DigitalOceanClient) New(client string, key string) *DigitalOceanClient
- func (d DigitalOceanClient) PowerOffDroplet(id uint) error
- type Image
- type ImagesResp
Constants ¶
View Source
const BuilderId = "pearkes.digitalocean"
The unique id for the builder
View Source
const DIGITALOCEAN_API_URL = "https://api.digitalocean.com"
Variables ¶
This section is empty.
Functions ¶
func NewRequest ¶
func NewRequest(d DigitalOceanClient, path string, params string) (map[string]interface{}, error)
Sends an api request and returns a generic map[string]interface of the response.
Types ¶
type DigitalOceanClient ¶
type DigitalOceanClient struct { // The base URL of the API BaseURL string // Credentials ClientID string APIKey string // contains filtered or unexported fields }
func (DigitalOceanClient) CreateDroplet ¶
func (d DigitalOceanClient) CreateDroplet(name string, size uint, image uint, region uint, keyId uint) (uint, error)
Creates a droplet and returns it's id
func (DigitalOceanClient) CreateKey ¶
func (d DigitalOceanClient) CreateKey(name string, pub string) (uint, error)
Creates an SSH Key and returns it's id
func (DigitalOceanClient) CreateSnapshot ¶
func (d DigitalOceanClient) CreateSnapshot(id uint, name string) error
Creates a snaphot of a droplet by it's ID
func (DigitalOceanClient) DestroyDroplet ¶
func (d DigitalOceanClient) DestroyDroplet(id uint) error
Destroys a droplet
func (DigitalOceanClient) DestroyImage ¶
func (d DigitalOceanClient) DestroyImage(id uint) error
Destroys an image by its ID.
func (DigitalOceanClient) DestroyKey ¶
func (d DigitalOceanClient) DestroyKey(id uint) error
Destroys an SSH key
func (DigitalOceanClient) DropletStatus ¶
func (d DigitalOceanClient) DropletStatus(id uint) (string, string, error)
Returns DO's string representation of status "off" "new" "active" etc.
func (DigitalOceanClient) Images ¶
func (d DigitalOceanClient) Images() ([]Image, error)
Returns all available images.
func (DigitalOceanClient) New ¶
func (d DigitalOceanClient) New(client string, key string) *DigitalOceanClient
Creates a new client for communicating with DO
func (DigitalOceanClient) PowerOffDroplet ¶
func (d DigitalOceanClient) PowerOffDroplet(id uint) error
Powers off a droplet
type ImagesResp ¶
type ImagesResp struct {
Images []Image
}
Click to show internal directories.
Click to hide internal directories.