Documentation ¶
Index ¶
- Variables
- func AddBoolFlag(cmd *Command, name string, def bool, desc string, opts ...flagOpt)
- func AddIntFlag(cmd *Command, name string, def int, desc string, opts ...flagOpt)
- func AddStringFlag(cmd *Command, name, dflt, desc string, opts ...flagOpt)
- func AddStringSliceFlag(cmd *Command, name string, def []string, desc string, opts ...flagOpt)
- func AskForConfirm(message string) error
- func Execute()
- func RunAccountGet(c *CmdConfig) error
- func RunAccountRateLimit(c *CmdConfig) error
- func RunAuthInit(c *CmdConfig) error
- func RunCmdActionGet(c *CmdConfig) error
- func RunCmdActionList(c *CmdConfig) error
- func RunCmdActionWait(c *CmdConfig) error
- func RunCmdTagCreate(c *CmdConfig) error
- func RunCmdTagDelete(c *CmdConfig) error
- func RunCmdTagGet(c *CmdConfig) error
- func RunCmdTagList(c *CmdConfig) error
- func RunCmdTagUpdate(c *CmdConfig) error
- func RunDomainCreate(c *CmdConfig) error
- func RunDomainDelete(c *CmdConfig) error
- func RunDomainGet(c *CmdConfig) error
- func RunDomainList(c *CmdConfig) error
- func RunDropletActionChangeKernel(c *CmdConfig) error
- func RunDropletActionDisableBackups(c *CmdConfig) error
- func RunDropletActionEnableIPv6(c *CmdConfig) error
- func RunDropletActionEnablePrivateNetworking(c *CmdConfig) error
- func RunDropletActionGet(c *CmdConfig) error
- func RunDropletActionPasswordReset(c *CmdConfig) error
- func RunDropletActionPowerCycle(c *CmdConfig) error
- func RunDropletActionPowerOff(c *CmdConfig) error
- func RunDropletActionPowerOn(c *CmdConfig) error
- func RunDropletActionReboot(c *CmdConfig) error
- func RunDropletActionRebuild(c *CmdConfig) error
- func RunDropletActionRename(c *CmdConfig) error
- func RunDropletActionResize(c *CmdConfig) error
- func RunDropletActionRestore(c *CmdConfig) error
- func RunDropletActionShutdown(c *CmdConfig) error
- func RunDropletActionSnapshot(c *CmdConfig) error
- func RunDropletActionUpgrade(c *CmdConfig) error
- func RunDropletActions(c *CmdConfig) error
- func RunDropletBackups(c *CmdConfig) error
- func RunDropletCreate(c *CmdConfig) error
- func RunDropletDelete(c *CmdConfig) error
- func RunDropletGet(c *CmdConfig) error
- func RunDropletKernels(c *CmdConfig) error
- func RunDropletList(c *CmdConfig) error
- func RunDropletNeighbors(c *CmdConfig) error
- func RunDropletSnapshots(c *CmdConfig) error
- func RunDropletTag(c *CmdConfig) error
- func RunDropletUntag(c *CmdConfig) error
- func RunFloatingIPActionsAssign(c *CmdConfig) error
- func RunFloatingIPActionsGet(c *CmdConfig) error
- func RunFloatingIPActionsUnassign(c *CmdConfig) error
- func RunFloatingIPCreate(c *CmdConfig) error
- func RunFloatingIPDelete(c *CmdConfig) error
- func RunFloatingIPGet(c *CmdConfig) error
- func RunFloatingIPList(c *CmdConfig) error
- func RunImageActionsGet(c *CmdConfig) error
- func RunImageActionsTransfer(c *CmdConfig) error
- func RunImagesDelete(c *CmdConfig) error
- func RunImagesGet(c *CmdConfig) error
- func RunImagesList(c *CmdConfig) error
- func RunImagesListApplication(c *CmdConfig) error
- func RunImagesListDistribution(c *CmdConfig) error
- func RunImagesListUser(c *CmdConfig) error
- func RunImagesUpdate(c *CmdConfig) error
- func RunKeyCreate(c *CmdConfig) error
- func RunKeyDelete(c *CmdConfig) error
- func RunKeyGet(c *CmdConfig) error
- func RunKeyImport(c *CmdConfig) error
- func RunKeyList(c *CmdConfig) error
- func RunKeyUpdate(c *CmdConfig) error
- func RunPluginList(c *CmdConfig) error
- func RunPluginRun(c *CmdConfig) error
- func RunRecordCreate(c *CmdConfig) error
- func RunRecordDelete(c *CmdConfig) error
- func RunRecordList(c *CmdConfig) error
- func RunRecordUpdate(c *CmdConfig) error
- func RunRegionList(c *CmdConfig) error
- func RunSSH(c *CmdConfig) error
- func RunSizeList(c *CmdConfig) error
- func RunVolumeAttach(c *CmdConfig) error
- func RunVolumeCreate(c *CmdConfig) error
- func RunVolumeDelete(c *CmdConfig) error
- func RunVolumeDetach(c *CmdConfig) error
- func RunVolumeGet(c *CmdConfig) error
- func RunVolumeList(c *CmdConfig) error
- type CmdConfig
- type CmdRunner
- type Command
- func Account() *Command
- func Actions() *Command
- func Auth() *Command
- func CmdBuilder(parent *Command, cr CmdRunner, cliText, desc string, out io.Writer, ...) *Command
- func Domain() *Command
- func Droplet() *Command
- func DropletAction() *Command
- func FloatingIP() *Command
- func FloatingIPAction() *Command
- func ImageAction() *Command
- func Images() *Command
- func Plugin() *Command
- func Region() *Command
- func SSH(parent *Command) *Command
- func SSHKeys() *Command
- func Size() *Command
- func Tags() *Command
- func Version() *Command
- func Volume() *Command
- func VolumeAction() *Command
- type Displayable
- type UnknownSchemeError
Constants ¶
This section is empty.
Variables ¶
var DoitCmd = &Command{ Command: &cobra.Command{ Use: "doctl", Short: "doctl is a command line interface for the DigitalOcean API.", }, }
DoitCmd is the base command.
var ErrNoAccessToken = errors.New("no access token has been configured")
ErrNoAccessToken is an error for when there is no access token.
var ErrUnknownTerminal = errors.New("unknown terminal")
ErrUnknownTerminal signies an unknown terminal. It is returned when doit can't ascertain the current terminal type with requesting an auth token.
var Output string
Output holds the global output format.
var Token string
Token holds the global authorization token.
var Trace bool
Trace toggles http tracing output.
var Verbose bool
Verbose toggles verbose output.
var Writer = os.Stdout
Writer is where output should be written to.
Functions ¶
func AddBoolFlag ¶ added in v1.0.0
AddBoolFlag adds a boolean flag to a command.
func AddIntFlag ¶ added in v1.0.0
AddIntFlag adds an integr flag to a command.
func AddStringFlag ¶ added in v1.0.0
AddStringFlag adds a string flag to a command.
func AddStringSliceFlag ¶ added in v1.0.0
AddStringSliceFlag adds a string slice flag to a command.
func AskForConfirm ¶ added in v1.5.0
func RunAccountRateLimit ¶ added in v1.0.0
RunAccountRateLimit retrieves API rate limits for the account.
func RunAuthInit ¶ added in v1.4.0
RunAuthInit initializes the doctl config. Configuration is stored in $XDG_CONFIG_HOME/doctl. On Unix, if XDG_CONFIG_HOME is not set, use $HOME/.config. On Windows use %APPDATA%/doctl/config.
func RunCmdActionWait ¶ added in v1.0.0
RunCmdActionWait waits for an action to complete or error.
func RunCmdTagCreate ¶ added in v1.1.0
RunCmdTagCreate runs tag create.
func RunCmdTagDelete ¶ added in v1.1.0
RunCmdTagDelete runs tag delete.
func RunCmdTagGet ¶ added in v1.1.0
RunCmdTagGet runs tag get.
func RunCmdTagList ¶ added in v1.1.0
RunCmdTagList runs tag list.
func RunCmdTagUpdate ¶ added in v1.1.0
RunCmdTagUpdate runs tag update.
func RunDomainDelete ¶
RunDomainDelete deletes a domain by name.
func RunDropletActionChangeKernel ¶
RunDropletActionChangeKernel changes the kernel for a droplet.
func RunDropletActionDisableBackups ¶
RunDropletActionDisableBackups disables backups for a droplet.
func RunDropletActionEnableIPv6 ¶
RunDropletActionEnableIPv6 enables IPv6 for a droplet.
func RunDropletActionEnablePrivateNetworking ¶
RunDropletActionEnablePrivateNetworking enables private networking for a droplet.
func RunDropletActionGet ¶
RunDropletActionGet returns a droplet action by id.
func RunDropletActionPasswordReset ¶
RunDropletActionPasswordReset resets the droplet root password.
func RunDropletActionPowerCycle ¶
RunDropletActionPowerCycle power cycles a droplet.
func RunDropletActionPowerOff ¶
RunDropletActionPowerOff turns droplet power off.
func RunDropletActionPowerOn ¶
RunDropletActionPowerOn turns droplet power on.
func RunDropletActionReboot ¶
RunDropletActionReboot reboots a droplet.
func RunDropletActionRebuild ¶
RunDropletActionRebuild rebuilds a droplet using an image id or slug.
func RunDropletActionRename ¶
RunDropletActionRename renames a droplet.
func RunDropletActionResize ¶
RunDropletActionResize resizesx a droplet giving a size slug and optionally expands the disk.
func RunDropletActionRestore ¶
RunDropletActionRestore restores a droplet using an image id.
func RunDropletActionShutdown ¶
RunDropletActionShutdown shuts a droplet down.
func RunDropletActionSnapshot ¶
RunDropletActionSnapshot creates a snapshot for a droplet.
func RunDropletActionUpgrade ¶
RunDropletActionUpgrade upgrades a droplet.
func RunDropletActions ¶
RunDropletActions returns a list of actions for a droplet.
func RunDropletBackups ¶
RunDropletBackups returns a list of backup images for a droplet.
func RunDropletCreate ¶
RunDropletCreate creates a droplet.
func RunDropletDelete ¶
RunDropletDelete destroy a droplet by id.
func RunDropletKernels ¶
RunDropletKernels returns a list of available kernels for a droplet.
func RunDropletList ¶
RunDropletList returns a list of droplets.
func RunDropletNeighbors ¶
RunDropletNeighbors returns a list of droplet neighbors.
func RunDropletSnapshots ¶
RunDropletSnapshots returns a list of available kernels for a droplet.
func RunDropletTag ¶ added in v1.1.0
RunDropletTag adds a tag to a droplet.
func RunDropletUntag ¶ added in v1.1.0
RunDropletUntag untags a droplet.
func RunFloatingIPActionsAssign ¶
RunFloatingIPActionsAssign assigns a floating IP to a droplet.
func RunFloatingIPActionsGet ¶
RunFloatingIPActionsGet retrieves an action for a floating IP.
func RunFloatingIPActionsUnassign ¶
RunFloatingIPActionsUnassign unassigns a floating IP to a droplet.
func RunFloatingIPCreate ¶
RunFloatingIPCreate runs floating IP create.
func RunFloatingIPDelete ¶
RunFloatingIPDelete runs floating IP delete.
func RunFloatingIPGet ¶
RunFloatingIPGet retrieves a floating IP's details.
func RunFloatingIPList ¶
RunFloatingIPList runs floating IP create.
func RunImageActionsGet ¶
RunImageActionsGet retrieves an action for an image.
func RunImageActionsTransfer ¶
RunImageActionsTransfer an image.
func RunImagesGet ¶
RunImagesGet retrieves an image by id or slug.
func RunImagesListApplication ¶
RunImagesListApplication lists application iamges.
func RunImagesListDistribution ¶
RunImagesListDistribution lists distributions that are available.
func RunImagesListUser ¶
RunImagesListUser lists user images.
func RunPluginList ¶ added in v1.0.0
RunPluginList is a command for listing available plugins.
func RunPluginRun ¶ added in v1.0.0
RunPluginRun is a command for running a plugin.
func RunRecordCreate ¶
RunRecordCreate creates a domain record.
func RunRecordDelete ¶
RunRecordDelete deletes a domain record.
func RunRecordList ¶
RunRecordList list records for a domain.
func RunRecordUpdate ¶
RunRecordUpdate updates a domain record.
func RunVolumeAttach ¶ added in v1.3.0
RunVolumeAttach attaches a volume to a droplet.
func RunVolumeCreate ¶ added in v1.3.0
RunVolumeCreate creates a volume.
func RunVolumeDelete ¶ added in v1.3.0
RunVolumeDelete deletes a volume.
func RunVolumeDetach ¶ added in v1.3.0
RunVolumeDetach detaches a volume from the droplet it's attached to.
func RunVolumeGet ¶ added in v1.3.0
RunVolumeGet gets a volume.
func RunVolumeList ¶ added in v1.3.0
RunVolumeList returns a list of volumes.
Types ¶
type CmdConfig ¶ added in v1.0.0
type CmdConfig struct { NS string Doit doctl.Config Out io.Writer Args []string // services Keys func() do.KeysService Sizes func() do.SizesService Regions func() do.RegionsService Images func() do.ImagesService ImageActions func() do.ImageActionsService FloatingIPs func() do.FloatingIPsService FloatingIPActions func() do.FloatingIPActionsService Droplets func() do.DropletsService DropletActions func() do.DropletActionsService Domains func() do.DomainsService Actions func() do.ActionsService Account func() do.AccountService Tags func() do.TagsService Volumes func() do.VolumesService VolumeActions func() do.VolumeActionsService // contains filtered or unexported fields }
CmdConfig is a command configuration.
func NewCmdConfig ¶ added in v1.0.0
func NewCmdConfig(ns string, dc doctl.Config, out io.Writer, args []string, initGodo bool) (*CmdConfig, error)
NewCmdConfig creates an instance of a CmdConfig.
func (*CmdConfig) Display ¶ added in v1.0.0
func (c *CmdConfig) Display(d Displayable) error
Display displayes the output from a command.
type Command ¶ added in v1.0.0
type Command struct { *cobra.Command // DocCategories are the documentation categories this command belongs to. DocCategories []string IsIndex bool // contains filtered or unexported fields }
Command is a wrapper around cobra.Command that adds doctl specific functionality.
func CmdBuilder ¶ added in v1.0.0
func CmdBuilder(parent *Command, cr CmdRunner, cliText, desc string, out io.Writer, options ...cmdOption) *Command
CmdBuilder builds a new command.
func DropletAction ¶
func DropletAction() *Command
DropletAction creates the droplet-action command.
func FloatingIP ¶
func FloatingIP() *Command
FloatingIP creates the command heirarchy for floating ips.
func FloatingIPAction ¶
func FloatingIPAction() *Command
FloatingIPAction creates the floating IP action commmand.
func VolumeAction ¶ added in v1.3.0
func VolumeAction() *Command
VolumeAction creates the volume command
func (*Command) AddCommand ¶ added in v1.0.0
AddCommand adds child commands and adds child commands for cobra as well.
func (*Command) ChildCommands ¶ added in v1.0.0
ChildCommands returns the child commands.
type Displayable ¶ added in v1.0.0
type Displayable interface { Cols() []string ColMap() map[string]string KV() []map[string]interface{} JSON(io.Writer) error }
Displayable is a displable entity. These are used for printing results.
type UnknownSchemeError ¶ added in v0.6.0
type UnknownSchemeError struct {
Scheme string
}
UnknownSchemeError signifies an unknown HTTP scheme.
func (*UnknownSchemeError) Error ¶ added in v0.6.0
func (use *UnknownSchemeError) Error() string
Source Files ¶
- account.go
- actions.go
- auth.go
- command.go
- command_config.go
- commands.go
- confirmation.go
- doit.go
- domains.go
- droplet_actions.go
- droplets.go
- errors.go
- floating_ip_actions.go
- floating_ips.go
- header.go
- image_actions.go
- images.go
- output.go
- plugin.go
- regions.go
- sizes.go
- ssh.go
- sshkeys.go
- tags.go
- util.go
- version.go
- volume_actions.go
- volumes.go
- xdg.go