digitalocean

package
v0.0.0-...-e104627 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 8, 2015 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*http.Client
}

func New

func New(token string) (*Client, error)

func NewFromEnv

func NewFromEnv() (*Client, error)

func (*Client) Domains

func (client *Client) Domains() (*DomainsResponse, error)

func (*Client) Droplet

func (client *Client) Droplet(idOrSlug string) (*DropletResponse, error)

func (*Client) DropletDelete

func (client *Client) DropletDelete(idOrSlug string) error

func (*Client) Droplets

func (client *Client) Droplets() (*DropletsResponse, error)

func (*Client) Image

func (client *Client) Image(idOrSlug string) (*ImageResponse, error)

func (*Client) Images

func (client *Client) Images(page int) (*ImagesResponse, error)

func (*Client) Keys

func (client *Client) Keys() (*KeysResponse, error)

func (*Client) RebootDroplet

func (c *Client) RebootDroplet(id string) error

func (*Client) Regions

func (client *Client) Regions() (*RegionsResponse, error)

type CreateDroplet

type CreateDroplet struct {
	Name              string   `json:"name,omitempty"`   // required
	Region            string   `json:"region,omitempty"` // required
	Size              string   `json:"size,omitempty"`   // required
	Image             string   `json:"image,omitempty"`  // required
	SshKeys           []string `json:"ssh_keys,omitempty"`
	Backups           bool     `json:"backups,omitempty"`
	IPv6              bool     `json:"ipv6,omitempty"`
	PrivateNetworking bool     `json:"private_networking,omitempty"`
	UserData          string   `json:"user_data,omitempty"`
}

func (*CreateDroplet) Execute

func (c *CreateDroplet) Execute(client *Client) (*DropletResponse, error)

type Domain

type Domain struct {
	Name     string `json:"name,omitempty"`
	Ttl      string `json:"ttl,omitempty"`
	ZoneFile string `json:"zone_file,omitempty"`
}

type DomainsResponse

type DomainsResponse struct {
	Domains []*Domain `json:"domain,omitempty"`
	Meta    *Meta     `json:"meta,omitempty"`
}

type Droplet

type Droplet struct {
	Id          int       `json:"id,omitempty"`
	Name        string    `json:"name,omitempty"`
	Region      *Region   `json:"region,omitempty"`
	Image       *Image    `json:"image,omitempty"`
	Size        *Size     `json:"size,omitempty"`
	SizeSlug    string    `json:"size_slug,omitempty"`
	Locked      bool      `json:"locked,omitempty"`
	Status      string    `json:"status,omitempty"`
	Networks    *Networks `json:"networks,omitempty"`
	Kernel      *Kernel   `json:"kernel,omitempty"`
	CreatedAt   time.Time `json:"created_at,omitempty"`
	BackupIds   []int64   `json:"backup_ids,omitempty"`
	SnapshotIds []int64   `json:"snapshot_ids,omitempty"`
	ActionIds   []int64   `json:"action_ids,omitempty"`
}

type DropletResponse

type DropletResponse struct {
	Droplet *Droplet `json:"droplet,omitempty"`
}

type DropletsList

type DropletsList struct {
}

type DropletsResponse

type DropletsResponse struct {
	Droplets []*Droplet `json:"droplets"`
	Meta     *Meta      `json:"neta,omitempty"`
}

type Image

type Image struct {
	Id           int       `json:"id,omitempty"`
	Name         string    `json:"name,omitempty"`
	Distribution string    `json:"distribution,omitempty"`
	Slug         string    `json:"slug,omitempty"`
	Public       bool      `json:"public,omitempty"`
	Regions      []string  `json:"regions,omitempty"`
	CreatedAt    time.Time `json:"created_at,omitempty"`
}

type ImageResponse

type ImageResponse struct {
	Image *Image `json:"image,omitempty"`
}

type ImagesResponse

type ImagesResponse struct {
	Images []*Image `json:"images,omitempty"`
	Meta   *Meta    `json:"meta,omitempty"`
}

type Kernel

type Kernel struct {
	Id      int64  `json:"id,omitempty"`
	Name    string `json:"name,omitempty"`
	Version string `json:"version,omitempty"`
}

type KeysResponse

type KeysResponse struct {
	SshKeys []*SshKey `json:"ssh_keys"`
}

type Meta

type Meta struct {
	Total int `json:"total,omitempty"`
}

type Network

type Network struct {
	IpAddress string `json:"ip_address,omitempty"`
	Netmask   string `json:"netmask,omitempty"`
	Gateway   string `json:"gateway,omitempty"`
	Type      string `json:"type,omitempty"`
}

type Networks

type Networks struct {
	V4 []*Network `json:"v4,omitempty"`
	V6 []*Network `json:"v6,omitempty"`
}

type Region

type Region struct {
	Slug      string   `json:"slug,omitempty"`
	Name      string   `json:"name,omitempty"`
	Sizes     []string `json:"sizes,omitempty"`
	Available bool     `json:"available,omitempty"`
	Features  []string `json:"features,omitempty"`
}

type RegionsResponse

type RegionsResponse struct {
	Regions []*Region `json:"regions,omitempty"`
}

type Size

type Size struct {
	Slug          string      `json:"slug,omitempty"`
	Memory        int         `json:"memory,omitempty"`
	VCpus         int         `json:"v_cpus,omitempty"`
	Disk          int         `json:"disk,omitempty"`
	Transfer      interface{} `json:"transfer,omitempty"`
	PriceMonthley float64     `json:"price_monthley,omitempty"`
	PriceHourly   float64     `json:"price_hourly,omitempty"`
	Regions       []string    `json:"regions,omitempty"`
}

type SizesResponse

type SizesResponse struct {
	Sizes []*Size `json:"sizes,omitempty"`
}

type SshKey

type SshKey struct {
	Id          int    `json:"id,omitempty"`
	Fingerprint string `json:"fingerprint,omitempty"`
	PublicKey   string `json:"public_key,omitempty"`
	Name        string `json:"name,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL