doit

package module
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2015 License: BSD-3-Clause Imports: 17 Imported by: 0

README

DOIT

Travis Build Status [![Coverage Status] (https://coveralls.io/repos/bryanl/doit/badge.svg?branch=master)] (https://coveralls.io/r/bryanl/doit?branch=master)

NAME:
   doit - DigitalOcean Interactive Tool

USAGE:
   doit [global options] command [command options] [arguments...]

VERSION:
   0.4.0

COMMANDS:
   account		account commands
   action		action commands
   domain		domain commands
   droplet		droplet commands
   droplet-action	droplet action commands
   image-action		image action commands
   image		image commands
   key			ssh key commands
   region		region commands
   size			size commands
   ssh			SSH to droplet. Provide name or id
   help, h		Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --access-token 		DigitalOcean API V2 Access Token [$DIGITALOCEAN_ACCESS_TOKEN]
   --debug		Debug
   --output 		output format (json or text)
   --help, -h		show help
   --version, -v	print the version

Configuration

By default, doit will load a configuration file from $HOME/.doitcfg if found.

Configuration OPTIONS
  • access-token - The DigitalOcean access token. You can generate a token in the Apps & API Of the DigitalOcean control panel.
  • output - Type of output to display results in. Choices are json or text. If not supplied, doit will default to text.

Example:

{
  access-token: MY_TOKEN
  output: text
}

Building and dependencies

doit's dependencies are managed by godep. To add new packages, you must run godep save ./... to update the vendored dependencies. External dependencies have been rewritten using godep.

Documentation

Index

Constants

View Source
const (
	// ArgActionID is an action id argument.
	ArgActionID = "action-id"
	// ArgDomainName is a domain name argument.
	ArgDomainName = "domain-name"
	// ArgDropletID is a droplet id argument.
	ArgDropletID = "droplet-id"
	// ArgDropletWait is a wait for a droplet to be created argument.
	ArgDropletWait = "wait"
	// ArgKernelID is a ekrnel id argument.
	ArgKernelID = "kernel-id"
	// ArgImage is an image argument.
	ArgImage = "image"
	// ArgImageID is an image id argument.
	ArgImageID = "image-id"
	// ArgImagePublic is a public image argument.
	ArgImagePublic = "public"
	// ArgImageSlug is an image slug argment.
	ArgImageSlug = "image-slug"
	// ArgIPAddress is an IP address argument.
	ArgIPAddress = "ip-address"
	// ArgDropletName is a droplet name argument.
	ArgDropletName = "droplet-name"
	// ArgResizeDisk is a resize disk argument.
	ArgResizeDisk = "resize-disk"
	// ArgSnapshotName is a snapshot name arugment.
	ArgSnapshotName = "snapshot-name"
	// ArgBackups is an enable backups argument.
	ArgBackups = "enable-backups"
	// ArgIPv6 is an enable IPv6 argument.
	ArgIPv6 = "enable-ipv6"
	// ArgPrivateNetworking is an enable private networking argument.
	ArgPrivateNetworking = "enable-private-networking"
	// ArgRecordData is a record data argument.
	ArgRecordData = "record-data"
	// ArgRecordID is a record id argument.
	ArgRecordID = "record-id"
	// ArgRecordName is a record name argument.
	ArgRecordName = "record-name"
	// ArgRecordPort is a record port argument.
	ArgRecordPort = "record-port"
	// ArgRecordPriority is a record priority argument.
	ArgRecordPriority = "record-priority"
	// ArgRecordType is a record type argument.
	ArgRecordType = "record-type"
	// ArgRecordWeight is a record weight argument.
	ArgRecordWeight = "record-weight"
	// ArgRegionSlug is a region slug argument.
	ArgRegionSlug = "region"
	// ArgSizeSlug is a size slug argument.
	ArgSizeSlug = "size"
	// ArgsSSHKeyPath is a ssh argument.
	ArgsSSHKeyPath = "ssh-key-path"
	// ArgSSHKeys is a ssh key argument.
	ArgSSHKeys = "ssh-keys"
	// ArgsSSHPort is a ssh argument.
	ArgsSSHPort = "ssh-port"
	// ArgUserData is a user data argument.
	ArgUserData = "user-data"
	// ArgUserDataFile is a user data file location argument.
	ArgUserDataFile = "user-data-file"
	// ArgImageName name is an image name argument.
	ArgImageName = "image-name"
	// ArgKey is a key argument.
	ArgKey = "key"
	// ArgKeyName is a key name argument.
	ArgKeyName = "key-name"
	// ArgKeyPublicKey is a public key argument.
	ArgKeyPublicKey = "public-key"
	// ArgKeyPublicKeyFile is a public key file argument.
	ArgKeyPublicKeyFile = "public-key-file"
	// ArgSSHUser is a SSH user argument.
	ArgSSHUser = "ssh-user"

	// ArgOutput is an output type argument.
	ArgOutput = "output"
)
View Source
const (
	// NSRoot is a configuration key that signifies this value is at the root.
	NSRoot = "doit"
)

Variables

This section is empty.

Functions

func DisplayOutput added in v0.5.0

func DisplayOutput(item interface{}, out io.Writer) error

DisplayOutput displays an object or group of objects to a user. It checks to see what the output type should be.

func PaginateResp

func PaginateResp(gen Generator) ([]interface{}, error)

PaginateResp paginates a Response.

Types

type AccountServiceMock

type AccountServiceMock struct {
	GetFn func() (*godo.Account, *godo.Response, error)
}

AccountServiceMock mocks github.com/digitalocean/AccountService.

func (*AccountServiceMock) Get

Get mocks github.com/digitalocean/AccountService.Get.

type ActionsServiceMock

type ActionsServiceMock struct {
	GetFn  func(id int) (*godo.Action, *godo.Response, error)
	ListFn func(opts *godo.ListOptions) ([]godo.Action, *godo.Response, error)
}

ActionsServiceMock mocks github.com/digitalocean/godo/ActionsService.

func (*ActionsServiceMock) Get

func (s *ActionsServiceMock) Get(id int) (*godo.Action, *godo.Response, error)

Get is a mocked method.

func (*ActionsServiceMock) List

List is a mocked method.

type Command added in v0.5.0

type Command interface {
	Run(args ...string) ([]byte, error)
	Start(args ...string) error
	Stop() error
}

Command runs commands.

type Config

type Config interface {
	GetGodoClient() *godo.Client
	SSH(user, host, keyPath string, port int) Runner
	Set(ns, key string, val interface{})
	GetString(ns, key string) (string, error)
	GetBool(ns, key string) (bool, error)
	GetInt(ns, key string) (int, error)
	GetStringSlice(ns, key string) ([]string, error)
}

Config is an interface that represent doit's config.

var (
	// DoitConfig holds the app's current configuration.
	DoitConfig Config = &LiveConfig{}
)

type DomainsServiceMock

type DomainsServiceMock struct {
	ListFn   func(opts *godo.ListOptions) ([]godo.Domain, *godo.Response, error)
	GetFn    func(string) (*godo.Domain, *godo.Response, error)
	CreateFn func(*godo.DomainCreateRequest) (*godo.Domain, *godo.Response, error)
	DeleteFn func(string) (*godo.Response, error)

	RecordsFn      func(string, *godo.ListOptions) ([]godo.DomainRecord, *godo.Response, error)
	RecordFn       func(string, int) (*godo.DomainRecord, *godo.Response, error)
	DeleteRecordFn func(string, int) (*godo.Response, error)
	EditRecordFn   func(string, int, *godo.DomainRecordEditRequest) (*godo.DomainRecord, *godo.Response, error)
	CreateRecordFn func(string, *godo.DomainRecordEditRequest) (*godo.DomainRecord, *godo.Response, error)
}

DomainsServiceMock mocks github.com/digitalocean/godo/DomainsService.

func (*DomainsServiceMock) Create

Create is a mocked method.

func (*DomainsServiceMock) CreateRecord

CreateRecord is a mocked method.

func (*DomainsServiceMock) Delete

func (s *DomainsServiceMock) Delete(name string) (*godo.Response, error)

Delete is a mocked method.

func (*DomainsServiceMock) DeleteRecord

func (s *DomainsServiceMock) DeleteRecord(name string, id int) (*godo.Response, error)

DeleteRecord is a mocked method.

func (*DomainsServiceMock) EditRecord

EditRecord is a mocked method.

func (*DomainsServiceMock) Get

func (s *DomainsServiceMock) Get(name string) (*godo.Domain, *godo.Response, error)

Get is a mocked method.

func (*DomainsServiceMock) List

List is a mocked method.

func (*DomainsServiceMock) Record

func (s *DomainsServiceMock) Record(name string, id int) (*godo.DomainRecord, *godo.Response, error)

Record is a mocked method.

func (*DomainsServiceMock) Records

func (s *DomainsServiceMock) Records(name string, opts *godo.ListOptions) ([]godo.DomainRecord, *godo.Response, error)

Records is a mocked method.

type DropletActionsServiceMock

type DropletActionsServiceMock struct {
	ChangeKernelFn            func(id, kernelID int) (*godo.Action, *godo.Response, error)
	DisableBackupsFn          func(id int) (*godo.Action, *godo.Response, error)
	EnableIPv6Fn              func(id int) (*godo.Action, *godo.Response, error)
	EnablePrivateNetworkingFn func(id int) (*godo.Action, *godo.Response, error)
	GetFn                     func(dropletID, actionID int) (*godo.Action, *godo.Response, error)
	GetByURIFn                func(rawurl string) (*godo.Action, *godo.Response, error)
	PasswordResetFn           func(id int) (*godo.Action, *godo.Response, error)
	PowerCycleFn              func(id int) (*godo.Action, *godo.Response, error)
	PowerOffFn                func(id int) (*godo.Action, *godo.Response, error)
	PowerOnFn                 func(id int) (*godo.Action, *godo.Response, error)
	RebootFn                  func(id int) (*godo.Action, *godo.Response, error)
	RebuildByImageIDFn        func(id, imageID int) (*godo.Action, *godo.Response, error)
	RebuildByImageSlugFn      func(id int, slug string) (*godo.Action, *godo.Response, error)
	RenameFn                  func(id int, name string) (*godo.Action, *godo.Response, error)
	ResizeFn                  func(id int, sizeSlug string, resizeDisk bool) (*godo.Action, *godo.Response, error)
	RestoreFn                 func(id, imageID int) (*godo.Action, *godo.Response, error)
	ShutdownFn                func(id int) (*godo.Action, *godo.Response, error)
	SnapshotFn                func(id int, name string) (*godo.Action, *godo.Response, error)
	UpgradeFn                 func(id int) (*godo.Action, *godo.Response, error)
}

DropletActionsServiceMock mocks github.com/digitalocean/godo/DropletActionsServiceMock.

func (*DropletActionsServiceMock) ChangeKernel

func (s *DropletActionsServiceMock) ChangeKernel(id, kernelID int) (*godo.Action, *godo.Response, error)

ChangeKernel is a mocked method.

func (*DropletActionsServiceMock) DisableBackups

func (s *DropletActionsServiceMock) DisableBackups(id int) (*godo.Action, *godo.Response, error)

DisableBackups is a mocked method.

func (*DropletActionsServiceMock) EnableIPv6

func (s *DropletActionsServiceMock) EnableIPv6(id int) (*godo.Action, *godo.Response, error)

EnableIPv6 is a mocked method.

func (*DropletActionsServiceMock) EnablePrivateNetworking

func (s *DropletActionsServiceMock) EnablePrivateNetworking(id int) (*godo.Action, *godo.Response, error)

EnablePrivateNetworking is a mocked method.

func (*DropletActionsServiceMock) Get

func (s *DropletActionsServiceMock) Get(dropletID, actionID int) (*godo.Action, *godo.Response, error)

Get is a mocked method.

func (*DropletActionsServiceMock) GetByURI

func (s *DropletActionsServiceMock) GetByURI(rawurl string) (*godo.Action, *godo.Response, error)

GetByURI is a mocked method.

func (*DropletActionsServiceMock) PasswordReset

func (s *DropletActionsServiceMock) PasswordReset(id int) (*godo.Action, *godo.Response, error)

PasswordReset is a mocked method.

func (*DropletActionsServiceMock) PowerCycle

func (s *DropletActionsServiceMock) PowerCycle(id int) (*godo.Action, *godo.Response, error)

PowerCycle is a mocked method.

func (*DropletActionsServiceMock) PowerOff

func (s *DropletActionsServiceMock) PowerOff(id int) (*godo.Action, *godo.Response, error)

PowerOff is a mocked method.

func (*DropletActionsServiceMock) PowerOn

PowerOn is a mocked method.

func (*DropletActionsServiceMock) Reboot

Reboot is a mocked method.

func (*DropletActionsServiceMock) RebuildByImageID

func (s *DropletActionsServiceMock) RebuildByImageID(id, imageID int) (*godo.Action, *godo.Response, error)

RebuildByImageID is a mocked method.

func (*DropletActionsServiceMock) RebuildByImageSlug

func (s *DropletActionsServiceMock) RebuildByImageSlug(id int, slug string) (*godo.Action, *godo.Response, error)

RebuildByImageSlug is a mocked method.

func (*DropletActionsServiceMock) Rename

func (s *DropletActionsServiceMock) Rename(id int, name string) (*godo.Action, *godo.Response, error)

Rename is a mocked method.

func (*DropletActionsServiceMock) Resize

func (s *DropletActionsServiceMock) Resize(id int, sizeSlug string, resizeDisk bool) (*godo.Action, *godo.Response, error)

Resize is a mocked method.

func (*DropletActionsServiceMock) Restore

func (s *DropletActionsServiceMock) Restore(id, imageID int) (*godo.Action, *godo.Response, error)

Restore is a mocked method.

func (*DropletActionsServiceMock) Shutdown

func (s *DropletActionsServiceMock) Shutdown(id int) (*godo.Action, *godo.Response, error)

Shutdown is a mocked method.

func (*DropletActionsServiceMock) Snapshot

func (s *DropletActionsServiceMock) Snapshot(id int, name string) (*godo.Action, *godo.Response, error)

Snapshot is a mocked method.

func (*DropletActionsServiceMock) Upgrade

Upgrade is a mocked method.

type DropletsServiceMock

type DropletsServiceMock struct {
	ActionsFn   func(dropletID int, opt *godo.ListOptions) ([]godo.Action, *godo.Response, error)
	BackupsFn   func(dropletID int, opt *godo.ListOptions) ([]godo.Image, *godo.Response, error)
	CreateFn    func(createRequest *godo.DropletCreateRequest) (*godo.Droplet, *godo.Response, error)
	DeleteFn    func(dropletID int) (*godo.Response, error)
	GetFn       func(dropletID int) (*godo.Droplet, *godo.Response, error)
	KernelsFn   func(dropletID int, opt *godo.ListOptions) ([]godo.Kernel, *godo.Response, error)
	ListFn      func(opt *godo.ListOptions) ([]godo.Droplet, *godo.Response, error)
	NeighborsFn func(dropletID int) ([]godo.Droplet, *godo.Response, error)
	SnapshotsFn func(dropletID int, opt *godo.ListOptions) ([]godo.Image, *godo.Response, error)
}

DropletsServiceMock mocks github.com/digitalocean/godo/DropletsService.

func (*DropletsServiceMock) Actions

func (s *DropletsServiceMock) Actions(dropletID int, opt *godo.ListOptions) ([]godo.Action, *godo.Response, error)

Actions is a mocked method.

func (*DropletsServiceMock) Backups

func (s *DropletsServiceMock) Backups(dropletID int, opt *godo.ListOptions) ([]godo.Image, *godo.Response, error)

Backups is a mocked method.

func (*DropletsServiceMock) Create

func (s *DropletsServiceMock) Create(createRequest *godo.DropletCreateRequest) (*godo.Droplet, *godo.Response, error)

Create is a mocked method.

func (*DropletsServiceMock) Delete

func (s *DropletsServiceMock) Delete(dropletID int) (*godo.Response, error)

Delete is a mocked method.

func (*DropletsServiceMock) Get

func (s *DropletsServiceMock) Get(dropletID int) (*godo.Droplet, *godo.Response, error)

Get is a mocked method.

func (*DropletsServiceMock) Kernels

func (s *DropletsServiceMock) Kernels(dropletID int, opt *godo.ListOptions) ([]godo.Kernel, *godo.Response, error)

Kernels is a mocked method.

func (*DropletsServiceMock) List

List is a mocked method.

func (*DropletsServiceMock) Neighbors

func (s *DropletsServiceMock) Neighbors(dropletID int) ([]godo.Droplet, *godo.Response, error)

Neighbors is a mocked method.

func (*DropletsServiceMock) Snapshots

func (s *DropletsServiceMock) Snapshots(dropletID int, opt *godo.ListOptions) ([]godo.Image, *godo.Response, error)

Snapshots is a mocked method.

type FloatingIPActionsServiceMock added in v0.5.0

type FloatingIPActionsServiceMock struct {
	AssignFn   func(ip string, dropletID int) (*godo.Action, *godo.Response, error)
	UnassignFn func(ip string) (*godo.Action, *godo.Response, error)
	GetFn      func(ip string, actionID int) (*godo.Action, *godo.Response, error)
}

FloatingIPActionsServiceMock mocks github.com/digitalocean/godo/FloatingIPActionsService.

func (*FloatingIPActionsServiceMock) Assign added in v0.5.0

func (s *FloatingIPActionsServiceMock) Assign(ip string, dropletID int) (*godo.Action, *godo.Response, error)

Assign is a mocked method.

func (*FloatingIPActionsServiceMock) Get added in v0.5.0

func (s *FloatingIPActionsServiceMock) Get(ip string, actionID int) (*godo.Action, *godo.Response, error)

Get is a mocked method.

func (*FloatingIPActionsServiceMock) Unassign added in v0.5.0

Unassign is a mocked method.

type FloatingIPsServiceMock added in v0.5.0

type FloatingIPsServiceMock struct {
	ListFn   func(*godo.ListOptions) ([]godo.FloatingIP, *godo.Response, error)
	GetFn    func(string) (*godo.FloatingIP, *godo.Response, error)
	CreateFn func(*godo.FloatingIPCreateRequest) (*godo.FloatingIP, *godo.Response, error)
	DeleteFn func(string) (*godo.Response, error)
}

FloatingIPsServiceMock mocks github.com/digitalocean/godo/FloatingIPsService.

func (*FloatingIPsServiceMock) Create added in v0.5.0

Create is a mocked method.

func (*FloatingIPsServiceMock) Delete added in v0.5.0

func (f *FloatingIPsServiceMock) Delete(ip string) (*godo.Response, error)

Delete is a mocked method.

func (*FloatingIPsServiceMock) Get added in v0.5.0

Get is a mocked method.

func (*FloatingIPsServiceMock) List added in v0.5.0

List is a mocked method.

type Generator

type Generator func(*godo.ListOptions) ([]interface{}, *godo.Response, error)

Generator is a function that generates the list to be paginated.

type ImageActionsServiceMock

type ImageActionsServiceMock struct {
	GetFn      func(imageID, actionID int) (*godo.Action, *godo.Response, error)
	TransferFn func(imageID int, transferRequest *godo.ActionRequest) (*godo.Action, *godo.Response, error)
}

ImageActionsServiceMock mocks github.com/digitalocean/godo/ImagesActionsService.

func (*ImageActionsServiceMock) Get

func (s *ImageActionsServiceMock) Get(imageID, actionID int) (*godo.Action, *godo.Response, error)

Get is a mocked method.

func (*ImageActionsServiceMock) Transfer

func (s *ImageActionsServiceMock) Transfer(imageID int, transferRequest *godo.ActionRequest) (*godo.Action, *godo.Response, error)

Transfer is a mocked method.

type ImagesServiceMock

type ImagesServiceMock struct {
	ListFn             func(*godo.ListOptions) ([]godo.Image, *godo.Response, error)
	ListDistributionFn func(opt *godo.ListOptions) ([]godo.Image, *godo.Response, error)
	ListApplicationFn  func(opt *godo.ListOptions) ([]godo.Image, *godo.Response, error)
	ListUserFn         func(opt *godo.ListOptions) ([]godo.Image, *godo.Response, error)
	GetByIDFn          func(int) (*godo.Image, *godo.Response, error)
	GetBySlugFn        func(string) (*godo.Image, *godo.Response, error)
	UpdateFn           func(int, *godo.ImageUpdateRequest) (*godo.Image, *godo.Response, error)
	DeleteFn           func(int) (*godo.Response, error)
}

ImagesServiceMock mocks github.com/digitalocean/godo/ImagesService.

func (*ImagesServiceMock) Delete

func (s *ImagesServiceMock) Delete(id int) (*godo.Response, error)

Delete is a mocked method.

func (*ImagesServiceMock) GetByID

func (s *ImagesServiceMock) GetByID(id int) (*godo.Image, *godo.Response, error)

GetByID is a mocked method.

func (*ImagesServiceMock) GetBySlug

func (s *ImagesServiceMock) GetBySlug(slug string) (*godo.Image, *godo.Response, error)

GetBySlug is a mocked method.

func (*ImagesServiceMock) List

List is a mocked method.

func (*ImagesServiceMock) ListApplication

func (s *ImagesServiceMock) ListApplication(opts *godo.ListOptions) ([]godo.Image, *godo.Response, error)

ListApplication is a mocked method.

func (*ImagesServiceMock) ListDistribution

func (s *ImagesServiceMock) ListDistribution(opts *godo.ListOptions) ([]godo.Image, *godo.Response, error)

ListDistribution is a mocked method.

func (*ImagesServiceMock) ListUser

func (s *ImagesServiceMock) ListUser(opts *godo.ListOptions) ([]godo.Image, *godo.Response, error)

ListUser is a mocked method.

func (*ImagesServiceMock) Update

Update is a mocked method.

type KeysServiceMock

type KeysServiceMock struct {
	ListFn                func(*godo.ListOptions) ([]godo.Key, *godo.Response, error)
	GetByIDFn             func(int) (*godo.Key, *godo.Response, error)
	GetByFingerprintFn    func(string) (*godo.Key, *godo.Response, error)
	CreateFn              func(*godo.KeyCreateRequest) (*godo.Key, *godo.Response, error)
	UpdateByIDFn          func(int, *godo.KeyUpdateRequest) (*godo.Key, *godo.Response, error)
	UpdateByFingerprintFn func(string, *godo.KeyUpdateRequest) (*godo.Key, *godo.Response, error)
	DeleteByIDFn          func(int) (*godo.Response, error)
	DeleteByFingerprintFn func(string) (*godo.Response, error)
}

KeysServiceMock mocks github.com/digitalocean/godo/KeysService.

func (*KeysServiceMock) Create

Create is a mocked method.

func (*KeysServiceMock) DeleteByFingerprint

func (s *KeysServiceMock) DeleteByFingerprint(fingerprint string) (*godo.Response, error)

DeleteByFingerprint is a mocked method.

func (*KeysServiceMock) DeleteByID

func (s *KeysServiceMock) DeleteByID(id int) (*godo.Response, error)

DeleteByID is a mocked method.

func (*KeysServiceMock) GetByFingerprint

func (s *KeysServiceMock) GetByFingerprint(fingerprint string) (*godo.Key, *godo.Response, error)

GetByFingerprint is a mocked method.

func (*KeysServiceMock) GetByID

func (s *KeysServiceMock) GetByID(id int) (*godo.Key, *godo.Response, error)

GetByID is a mocked method.

func (*KeysServiceMock) List

func (s *KeysServiceMock) List(opts *godo.ListOptions) ([]godo.Key, *godo.Response, error)

List is a mocked method.

func (*KeysServiceMock) UpdateByFingerprint

func (s *KeysServiceMock) UpdateByFingerprint(fingerprint string, req *godo.KeyUpdateRequest) (*godo.Key, *godo.Response, error)

UpdateByFingerprint is a mocked method.

func (*KeysServiceMock) UpdateByID

func (s *KeysServiceMock) UpdateByID(id int, req *godo.KeyUpdateRequest) (*godo.Key, *godo.Response, error)

UpdateByID is a mocked method.

type LiveCommand added in v0.5.0

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

LiveCommand is a live implementation of Command.

func NewLiveCommand added in v0.5.0

func NewLiveCommand(path string) *LiveCommand

NewLiveCommand creates a LiveCommand.

func (*LiveCommand) Run added in v0.5.0

func (c *LiveCommand) Run(args ...string) ([]byte, error)

Run runs a LiveCommand with args and returns stdout and an error if there was one.

func (*LiveCommand) Start added in v0.5.0

func (c *LiveCommand) Start(args ...string) error

Start runs a LiveCommand with args and starts it. This would most likely block, so you should call it in a goroutine.

func (*LiveCommand) Stop added in v0.5.0

func (c *LiveCommand) Stop() error

Stop stops an existing LiveCommand.

type LiveConfig

type LiveConfig struct{}

LiveConfig is an implementation of Config for live values.

func (*LiveConfig) GetBool added in v0.5.0

func (c *LiveConfig) GetBool(ns, key string) (bool, error)

GetBool returns a config value as a bool.

func (*LiveConfig) GetGodoClient added in v0.5.0

func (c *LiveConfig) GetGodoClient() *godo.Client

GetGodoClient returns a GodoClient.

func (*LiveConfig) GetInt added in v0.5.0

func (c *LiveConfig) GetInt(ns, key string) (int, error)

GetInt returns a config value as an int.

func (*LiveConfig) GetString added in v0.5.0

func (c *LiveConfig) GetString(ns, key string) (string, error)

GetString returns a config value as a string.

func (*LiveConfig) GetStringSlice added in v0.5.0

func (c *LiveConfig) GetStringSlice(ns, key string) ([]string, error)

GetStringSlice returns a config value as a string slice.

func (*LiveConfig) SSH

func (c *LiveConfig) SSH(user, host, keyPath string, port int) Runner

SSH creates a ssh connection to a host.

func (*LiveConfig) Set added in v0.5.0

func (c *LiveConfig) Set(ns, key string, val interface{})

Set sets a config key.

type MissingArgsErr added in v0.5.0

type MissingArgsErr struct {
	Command string
}

MissingArgsErr is an error returned when their are too few arguments for a command.

func NewMissingArgsErr added in v0.5.0

func NewMissingArgsErr(cmd string) *MissingArgsErr

NewMissingArgsErr creates a MissingArgsErr instance.

func (*MissingArgsErr) Error added in v0.5.0

func (e *MissingArgsErr) Error() string

type MockCommand added in v0.5.0

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

MockCommand is a mock command implementation. It allows you simulate running an external command.

func NewMockCommand added in v0.5.0

func NewMockCommand(path string) *MockCommand

NewMockCommand createsd a MockCommand.

func (*MockCommand) Run added in v0.5.0

func (c *MockCommand) Run(args ...string) ([]byte, error)

Run simulates the running of a command.

func (*MockCommand) Start added in v0.5.0

func (c *MockCommand) Start(args ...string) error

Start simulates starting a command.

func (*MockCommand) Stop added in v0.5.0

func (c *MockCommand) Stop() error

Stop simulates stoping a command.

type MockRunner added in v0.5.0

type MockRunner struct {
	Err error
}

MockRunner is an implemenation of Runner for mocking.

func (*MockRunner) Run added in v0.5.0

func (tr *MockRunner) Run() error

Run mock runs things.

type RegionsServiceMock

type RegionsServiceMock struct {
	ListFn func(opts *godo.ListOptions) ([]godo.Region, *godo.Response, error)
}

RegionsServiceMock mocks github.com/digitalocean/godo/RegionsService.

func (*RegionsServiceMock) List

List is a mocked method.

type Runner added in v0.5.0

type Runner interface {
	Run() error
}

Runner is an interface that Runs things.

type SizesServiceMock

type SizesServiceMock struct {
	ListFn func(opts *godo.ListOptions) ([]godo.Size, *godo.Response, error)
}

SizesServiceMock mocks github.com/digitalocean/godo/SizesService.

func (*SizesServiceMock) List

func (s *SizesServiceMock) List(opts *godo.ListOptions) ([]godo.Size, *godo.Response, error)

List is a mocked method.

type TokenSource

type TokenSource struct {
	AccessToken string
}

TokenSource holds an oauth token.

func (*TokenSource) Token

func (t *TokenSource) Token() (*oauth2.Token, error)

Token returns an oauth token.

Directories

Path Synopsis
Godeps
cmd

Jump to

Keyboard shortcuts

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