usecases

package
v0.0.0-...-3eb98cc Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2017 License: MIT Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DOInteractor

type DOInteractor struct {
}

DOInteractor embeds an has the necessary fields to interact with the Digital Ocean API

func (DOInteractor) CreateDroplet

func (interactor DOInteractor) CreateDroplet(droplet domain.DropletRequest, token string) (*Instance, error)

CreateDroplet creates a doplet in Digital Ocean

func (DOInteractor) CreateKey

func (interactor DOInteractor) CreateKey(name, publicKey, token string) (*domain.Key, error)

CreateKey creates all the keys in the Digital Ocean provider

func (DOInteractor) DestroyDroplet

func (interactor DOInteractor) DestroyDroplet(id int, token string) error

DestroyDroplet destroys a droplet

func (DOInteractor) GetDroplet

func (interactor DOInteractor) GetDroplet(id int, token string) (*Instance, error)

GetDroplet gets a single droplet

func (DOInteractor) GetOauthURL

func (interactor DOInteractor) GetOauthURL(id, redirectURI string, scope []string) string

GetOauthURL returns the oauth URL

func (DOInteractor) GetToken

func (interactor DOInteractor) GetToken(code, id, secret, redirectURL string) (*domain.DOToken, error)

GetToken returns a token from Digital Ocean

func (DOInteractor) ListDroplets

func (interactor DOInteractor) ListDroplets(token string) ([]domain.Droplet, error)

ListDroplets lists all the droplets a user has in Digital Ocean

func (DOInteractor) ShowKeys

func (interactor DOInteractor) ShowKeys(token string) ([]domain.Key, error)

ShowKeys shoes all the keys from Digital Ocean

type Instance

type Instance struct {
	Provider string `json:"provider,omitempty"`
	domain.Droplet
}

Instance represens a created instance in any provider

Jump to

Keyboard shortcuts

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