Documentation ¶
Index ¶
- func Adapt(h http.Handler, adapters ...Adapter) http.Handler
- type Adapter
- type DOInteractor
- type WebServiceHandler
- func (handler WebServiceHandler) CreateDroplet(res http.ResponseWriter, req *http.Request)
- func (handler WebServiceHandler) CreateKey(res http.ResponseWriter, req *http.Request)
- func (handler WebServiceHandler) DOCallback(res http.ResponseWriter, req *http.Request)
- func (handler WebServiceHandler) DestroyDroplet(res http.ResponseWriter, req *http.Request)
- func (handler WebServiceHandler) GetInstance(res http.ResponseWriter, req *http.Request)
- func (handler WebServiceHandler) ListDroplets(res http.ResponseWriter, req *http.Request)
- func (handler WebServiceHandler) Login(res http.ResponseWriter, req *http.Request)
- func (handler WebServiceHandler) ShowKeys(res http.ResponseWriter, req *http.Request)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DOInteractor ¶
type DOInteractor interface { GetOauthURL(id, redirectURI string, scope []string) string GetToken(code, id, secret, redirectURL string) (*domain.DOToken, error) ShowKeys(token string) ([]domain.Key, error) CreateKey(name, publicKey, token string) (*domain.Key, error) CreateDroplet(droplet domain.DropletRequest, token string) (*usecases.Instance, error) ListDroplets(token string) ([]domain.Droplet, error) GetDroplet(id int, token string) (*usecases.Instance, error) DestroyDroplet(id int, token string) error }
DOInteractor defines the functions that the digital ocean interactor should perform
type WebServiceHandler ¶
type WebServiceHandler struct { Interactor DOInteractor ID string Secret string RedirectURI string Scopes []string APIHost string }
WebServiceHandler has the necessary fields for a web interface to perform its operations
func (WebServiceHandler) CreateDroplet ¶
func (handler WebServiceHandler) CreateDroplet(res http.ResponseWriter, req *http.Request)
CreateDroplet creates a droplet in Digital Ocean
func (WebServiceHandler) CreateKey ¶
func (handler WebServiceHandler) CreateKey(res http.ResponseWriter, req *http.Request)
CreateKey saves a key in a provider
func (WebServiceHandler) DOCallback ¶
func (handler WebServiceHandler) DOCallback(res http.ResponseWriter, req *http.Request)
DOCallback receives the OAUTH callback from Digital Ocean
func (WebServiceHandler) DestroyDroplet ¶
func (handler WebServiceHandler) DestroyDroplet(res http.ResponseWriter, req *http.Request)
func (WebServiceHandler) GetInstance ¶
func (handler WebServiceHandler) GetInstance(res http.ResponseWriter, req *http.Request)
GetInstance gets an instance from any provider
func (WebServiceHandler) ListDroplets ¶
func (handler WebServiceHandler) ListDroplets(res http.ResponseWriter, req *http.Request)
ListDroplets lists all the droplets in Digital Ocean
func (WebServiceHandler) Login ¶
func (handler WebServiceHandler) Login(res http.ResponseWriter, req *http.Request)
Login is a helper method to create an OAUTH token
func (WebServiceHandler) ShowKeys ¶
func (handler WebServiceHandler) ShowKeys(res http.ResponseWriter, req *http.Request)
ShowKeys returns all the keys of an user in the different providers
Click to show internal directories.
Click to hide internal directories.