ccclient

package
v0.0.142 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2015 License: Apache-2.0, GPL-2.0 Imports: 6 Imported by: 0

README

cloudcontroller-client wercker status GoDoc

Documentation

Index

Constants

View Source
const (
	//URLPWSLogin - default pws login url
	URLPWSLogin = "https://login.run.pivotal.io"
	//RouteLogin - default oauth endpoint for cf
	RouteLogin = "/oauth/token"

	HeaderAuth = "Authorization"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Error        string `json:"error"`
	ErrorDesc    string `json:"error_description"`
	AccessToken  string `json:"access_token"`
	TokenType    string `json:"token_type"`
	RefreshToken string `json:"refresh_token"`
	ExpiresIn    int    `json:"expires_in"`
	Scope        string `json:"scope"`
	Jti          string `json:"jti"`
	// contains filtered or unexported fields
}

Client - cloud controller client object

func New

func New(loginurl, user, pass string, client ClientDoer) *Client

New - creates a new cloud controller client

func (*Client) CreateAuthRequest

func (s *Client) CreateAuthRequest(verb, requestURL, path string, args interface{}) (*http.Request, error)

CreateAuthRequest - Creates a request w/ auth token added to the header to allow authenticated calls to the cloud controller

func (*Client) CreateRequest

func (s *Client) CreateRequest(verb, requestURL, path string, args interface{}) (*http.Request, error)

CreateRequest - Creates a request object targeted at the cloud controller

func (*Client) HttpClient

func (s *Client) HttpClient() ClientDoer

HttpClient - returns the internal client object

func (*Client) Login

func (s *Client) Login() (*Client, error)

Login - logs into the target cloud controller

type ClientDoer

type ClientDoer interface {
	Do(*http.Request) (*http.Response, error)
}

Jump to

Keyboard shortcuts

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