Documentation
¶
Index ¶
- type DigitalOcean
- func (do *DigitalOcean) CreateDroplets(ctx context.Context, region, size string, count int) ([]MachineCreated, error)
- func (do *DigitalOcean) DeleteDropletByID(ctx context.Context, ID int) (*MachineDeleted, error)
- func (do *DigitalOcean) DeleteDropletByTag(ctx context.Context, tag string) error
- func (do *DigitalOcean) ListDropletByTag(ctx context.Context, tag string) ([]Machine, error)
- func (do *DigitalOcean) ListRegions(ctx context.Context) ([]Region, error)
- func (do *DigitalOcean) ListSizes(ctx context.Context) ([]Size, error)
- type Machine
- type MachineCreated
- type MachineDeleted
- type Region
- type Size
- type TokenSource
- type UserData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DigitalOcean ¶
type DigitalOcean struct {
// contains filtered or unexported fields
}
DigitalOcean client.
func NewDigitalOceanClient ¶
func NewDigitalOceanClient(token string) (*DigitalOcean, error)
NewDigitalOceanClient creates a Digital Ocean client.
func (*DigitalOcean) CreateDroplets ¶
func (do *DigitalOcean) CreateDroplets(ctx context.Context, region, size string, count int) ([]MachineCreated, error)
CreateDroplets creates a new DigitalOcean droplet.
func (*DigitalOcean) DeleteDropletByID ¶
func (do *DigitalOcean) DeleteDropletByID(ctx context.Context, ID int) (*MachineDeleted, error)
DeleteDropletByID deletes a DigitalOcean droplet by ID.
func (*DigitalOcean) DeleteDropletByTag ¶
func (do *DigitalOcean) DeleteDropletByTag(ctx context.Context, tag string) error
DeleteDropletByTag deletes a DigitalOcean droplet by Tag.
func (*DigitalOcean) ListDropletByTag ¶
ListDropletByTag lists the droplets for a digitalocean account.
func (*DigitalOcean) ListRegions ¶
func (do *DigitalOcean) ListRegions(ctx context.Context) ([]Region, error)
ListRegions gets a list of DigitalOcean regions.
type Machine ¶
type Machine struct { ID int `json:"id"` Name string `json:"name"` Status string `json:"status"` SizeSlug string `json:"size_slug"` Created string `json:"created_at"` Region string `json:"region"` Tags []string `json:"tags"` Provider string `json:"provider"` }
Machine defines a machine struct from a provider.
type MachineCreated ¶
MachineCreated defines the response for creating a machine.
type MachineDeleted ¶
MachineDeleted defines the response for deleted a machine.
type TokenSource ¶
type TokenSource struct {
AccessToken string
}
TokenSource defines an access token for oauth2.TokenSource.
type UserData ¶
type UserData struct { AWSAccessKey string AWSSecretKey string SlackWebhook string CloudinitRedisHost string CloudinitRedisPort int CloudinitDatabaseHost string CloudinitDatabasePort int CloudinitDatabaseUser string CloudinitDatabasePassword string CloudinitDatabaseName string CloudinitWorkerImage string }
UserData defines the userdata used for cloud-init.