do

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2026 License: MIT Imports: 8 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 {
	// contains filtered or unexported fields
}

Client manages droplets on DigitalOcean.

func NewClient

func NewClient(ctx context.Context, cfg config.Config, logger *zap.SugaredLogger) *Client

NewClient creates a new DigitalOcean client.

func (*Client) CheckAPI

func (c *Client) CheckAPI() error

CheckAPI verifies that the API token is valid by fetching the account.

func (*Client) CreateDroplet

func (c *Client) CreateDroplet(name, region, size string) (types.Droplet, string, error)

CreateDroplet creates a new droplet and returns it along with the action HREF for monitoring.

func (*Client) ListDroplets

func (c *Client) ListDroplets() ([]types.Droplet, error)

ListDroplets lists all droplets with the configured tag.

func (*Client) RemoveDroplet

func (c *Client) RemoveDroplet(id int) error

RemoveDroplet deletes a droplet by ID.

func (*Client) WaitUntilReady

func (c *Client) WaitUntilReady(droplet *types.Droplet, actionHREF string) error

WaitUntilReady polls until the droplet is active and SSH-reachable. It uses the Actions API to wait for the droplet to become active, then switches to a tighter polling loop for SSH readiness.

type Option

type Option struct {
	Alias string `json:"alias"`
	Slug  string `json:"slug"`
}

Option represents a CLI alias mapped to a provider-specific value.

func RegionOptions

func RegionOptions() []Option

RegionOptions returns all region alias-to-slug mappings.

func SizeOptions

func SizeOptions() []Option

SizeOptions returns all size alias-to-slug mappings.

Jump to

Keyboard shortcuts

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