digitalocean

package module
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2024 License: GPL-3.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var INFO *log.LogFlag
View Source
var POLL *log.LogFlag

Functions

func FormatJSON

func FormatJSON(unformattedJSON string) (string, error)

formatJSON takes an unformatted JSON string and returns a formatted version.

func InitCreateWindow

func InitCreateWindow() *windowCreate

This is initializes the main DO object You can only have one of these

Types

type ArgsDo

type ArgsDo struct {
	DigitalOceanTimer int `arg:"--digitalocean-poll-interval" help:"how often to poll droplet status (default 60 seconds)"`
}

This struct can be used with the go-arg package

type DigitalOcean

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

func New

func New(p *gui.Node) *DigitalOcean

This is initializes the main DO object You can only have one of these

func (*DigitalOcean) Create

func (d *DigitalOcean) Create(name string, region string, size string, image string)

func (*DigitalOcean) Hide

func (d *DigitalOcean) Hide()

func (*DigitalOcean) ListDroplets

func (d *DigitalOcean) ListDroplets() bool

ListDroplets fetches and prints out the droplets along with their IPv4 and IPv6 addresses.

func (*DigitalOcean) ListSSHKeyID

func (d *DigitalOcean) ListSSHKeyID() error

func (d *DigitalOcean) ListDroplets() bool {

func (*DigitalOcean) NewDroplet

func (d *DigitalOcean) NewDroplet(dd *godo.Droplet) *Droplet

func (*DigitalOcean) PowerOff

func (d *DigitalOcean) PowerOff(dropletID int) error

func (*DigitalOcean) PowerOn

func (d *DigitalOcean) PowerOn(dropletID int) error

func (*DigitalOcean) Ready

func (d *DigitalOcean) Ready() bool

Returns true if the status is valid

func (*DigitalOcean) Show

func (d *DigitalOcean) Show()

func (*DigitalOcean) Toggle added in v0.20.2

func (d *DigitalOcean) Toggle()

func (*DigitalOcean) Update

func (d *DigitalOcean) Update() bool

type Droplet

type Droplet struct {
	ID int
	// contains filtered or unexported fields
}

func (*Droplet) Active

func (d *Droplet) Active() bool

func (*Droplet) Connect

func (d *Droplet) Connect()

func (*Droplet) Destroy

func (d *Droplet) Destroy()

func (*Droplet) Exists

func (d *Droplet) Exists() bool

func (*Droplet) GetDisk

func (d *Droplet) GetDisk() string

func (*Droplet) GetIPv4

func (d *Droplet) GetIPv4() string

func (*Droplet) GetIPv6

func (d *Droplet) GetIPv6() string

func (*Droplet) GetImage

func (d *Droplet) GetImage() string

func (*Droplet) GetMemory

func (d *Droplet) GetMemory() string

func (*Droplet) GetName

func (d *Droplet) GetName() string

func (*Droplet) GetSize

func (d *Droplet) GetSize() string

func (*Droplet) GetStatus

func (d *Droplet) GetStatus() string

func (*Droplet) HasIPv4

func (d *Droplet) HasIPv4() bool

func (*Droplet) HasIPv6

func (d *Droplet) HasIPv6() bool

func (*Droplet) Hide

func (d *Droplet) Hide()

func (*Droplet) On

func (d *Droplet) On() bool

Returns true if the droplet is running

func (*Droplet) PowerOff

func (d *Droplet) PowerOff()

func (*Droplet) PowerOn

func (d *Droplet) PowerOn()

func (*Droplet) Ready

func (d *Droplet) Ready() bool

Returns true if the droplet is finished installing

func (*Droplet) Show

func (d *Droplet) Show()
type Droplet struct {
	ID               int           `json:"id,float64,omitempty"`
	Name             string        `json:"name,omitempty"`
	Memory           int           `json:"memory,omitempty"`
	Vcpus            int           `json:"vcpus,omitempty"`
	Disk             int           `json:"disk,omitempty"`
	Region           *Region       `json:"region,omitempty"`
	Image            *Image        `json:"image,omitempty"`
	Size             *Size         `json:"size,omitempty"`
	SizeSlug         string        `json:"size_slug,omitempty"`
	BackupIDs        []int         `json:"backup_ids,omitempty"`
	NextBackupWindow *BackupWindow `json:"next_backup_window,omitempty"`
	SnapshotIDs      []int         `json:"snapshot_ids,omitempty"`
	Features         []string      `json:"features,omitempty"`
	Locked           bool          `json:"locked,bool,omitempty"`
	Status           string        `json:"status,omitempty"`
	Networks         *Networks     `json:"networks,omitempty"`
	Created          string        `json:"created_at,omitempty"`
	Kernel           *Kernel       `json:"kernel,omitempty"`
	Tags             []string      `json:"tags,omitempty"`
	VolumeIDs        []string      `json:"volume_ids"`
	VPCUUID          string        `json:"vpc_uuid,omitempty"`
}

func (*Droplet) Update

func (d *Droplet) Update(dpoll *godo.Droplet)

Jump to

Keyboard shortcuts

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