client

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2015 License: Apache-2.0, Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cancel

func Cancel() error

Cancel deletes a user's account.

func CheckConection

func CheckConection(client *http.Client, controllerURL url.URL) error

CheckConection checks that the user is connected to a network and the URL points to a valid controller.

func CreateHTTPClient

func CreateHTTPClient(sslVerify bool) *http.Client

CreateHTTPClient creates a HTTP Client with proper SSL options.

func Login

func Login(controllerURL url.URL, username string, password string, sslVerify bool) error

Login logs a user into a Deis controller.

func Logout

func Logout() error

Logout from a Deis controller by deleting config file.

func Passwd

func Passwd(username string, password string, newPassword string) error

Passwd changes a user's password.

func Regenerate

func Regenerate(username string, all bool) error

Regenerate regenenerates a user's token.

func Register

func Register(controllerURL url.URL, username string, password string, email string, sslVerify bool,
	loginAfter bool) error

Register creates a account on a Deis controller.

func Webbrowser

func Webbrowser(u string) (err error)

Webbrowser opens a URL with the default browser.

Types

type Client

type Client struct {
	// HTTP client used to communicate with the API.
	HTTPClient *http.Client

	// SSLVerify determines whether or not to verify SSL conections.
	SSLVerify bool

	// URL used to communicate with the controller.
	ControllerURL url.URL

	// Token is used to authenticate the request against the API.
	Token string

	// Username is the name of the user performing requests against the API.
	Username string
}

Client oversees the interaction between the client and controller

func New

func New() (*Client, error)

New creates a new client from a settings file.

func (Client) BasicRequest

func (c Client) BasicRequest(method string, path string, body []byte) (string, error)

BasicRequest makes a simple http request on the controller.

func (Client) CreateRemote

func (c Client) CreateRemote(remote, appID string) error

CreateRemote adds a git remote in the current directory.

func (Client) DeleteRemote

func (c Client) DeleteRemote(appID string) error

DeleteRemote removes a git remote in the current directory.

func (Client) DetectApp

func (c Client) DetectApp() (string, error)

DetectApp detects if there is deis remote in git.

func (Client) RemoteURL

func (c Client) RemoteURL(appID string) string

RemoteURL returns the git URL of app.

func (Client) Request

func (c Client) Request(method string, path string, body []byte) (*http.Response, error)

Request makes a HTTP request on the controller.

func (Client) Save

func (c Client) Save() error

Save settings to a file

Jump to

Keyboard shortcuts

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