Help us shape the future of Go! Take the 2026 Go Developer Survey

do

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2023 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 API

type API struct {
	// contains filtered or unexported fields
}

func New

func New(opts *Options) (*API, error)

func (*API) AddKey

func (a *API) AddKey(ctx context.Context, name, key string) (int, error)

func (*API) CreateDroplet

func (a *API) CreateDroplet(ctx context.Context, name string, sshKeyID int, userdata string) (*godo.Droplet, error)

func (*API) CreateImage added in v0.20.0

func (a *API) CreateImage(ctx context.Context, name, url string) (*godo.Image, error)

func (*API) DeleteDroplet

func (a *API) DeleteDroplet(ctx context.Context, dropletID int) error

func (*API) DeleteImage

func (a *API) DeleteImage(ctx context.Context, imageID int) error

func (*API) DeleteKey

func (a *API) DeleteKey(ctx context.Context, keyID int) error

func (*API) GC

func (a *API) GC(ctx context.Context, gracePeriod time.Duration) error

func (*API) GetDroplet

func (a *API) GetDroplet(ctx context.Context, dropletID int) (*godo.Droplet, error)

func (*API) GetUserImage

func (a *API) GetUserImage(ctx context.Context, imageName string, inRegion bool) (*godo.Image, error)

func (*API) ListKeys added in v0.9.0

func (a *API) ListKeys(ctx context.Context) ([]godo.Key, error)

func (*API) PreflightCheck

func (a *API) PreflightCheck(ctx context.Context) error

func (*API) SnapshotDroplet

func (a *API) SnapshotDroplet(ctx context.Context, dropletID int, name string) error

SnapshotDroplet creates a snapshot of a droplet and waits until complete. The Snapshot API doesn't return the snapshot ID, so we don't either.

type Options

type Options struct {
	*platform.Options

	// Config file. Defaults to $HOME/.config/digitalocean.json.
	ConfigPath string
	// Profile name
	Profile string
	// Personal access token (overrides config profile)
	AccessToken string

	// Region slug (e.g. "sfo2")
	Region string
	// Droplet size slug (e.g. "512mb")
	Size string
	// Numeric image ID, {alpha, beta, stable}, or user image name
	Image string
}

Jump to

Keyboard shortcuts

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