cloudcontroller

package
v6.25.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2017 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package cloudcontroller contains shared utilies between the V2 and V3 clients.

These sets of packages are still under development/pre-pre-pre...alpha. Use at your own risk! Functionality and design may change without warning.

Where are the clients?

These clients live in ccv2 and ccv3 packages. Each of them only works with the V2 and V3 api respectively.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APINotFoundError

type APINotFoundError struct {
	URL string
}

APINotFoundError is returned when the API endpoint is not found.

func (APINotFoundError) Error

func (e APINotFoundError) Error() string

type BadRequestError

type BadRequestError struct {
	Message string
}

BadRequestError is returned when the server says the request was bad.

func (BadRequestError) Error

func (e BadRequestError) Error() string

type CloudControllerConnection

type CloudControllerConnection struct {
	HTTPClient *http.Client
	UserAgent  string
}

CloudControllerConnection represents a connection to the Cloud Controller server.

func NewConnection

func NewConnection(config Config) *CloudControllerConnection

NewConnection returns a new CloudControllerConnection with provided configuration.

func (*CloudControllerConnection) Make

func (connection *CloudControllerConnection) Make(request *http.Request, passedResponse *Response) error

Make performs the request and parses the response.

type Config

type Config struct {
	DialTimeout       time.Duration
	SkipSSLValidation bool
}

Config is for configuring a CloudControllerConnection.

type Connection

type Connection interface {
	Make(request *http.Request, passedResponse *Response) error
}

Connection creates and executes http requests

type ForbiddenError

type ForbiddenError struct {
	Message string
}

ForbiddenError is returned when the client is forbidden from executing the request.

func (ForbiddenError) Error

func (e ForbiddenError) Error() string

type InvalidAuthTokenError

type InvalidAuthTokenError struct {
	Message string
}

InvalidAuthTokenError is returned when the client has an invalid authorization header.

func (InvalidAuthTokenError) Error

func (e InvalidAuthTokenError) Error() string

type NotFoundError

type NotFoundError struct {
	Message string
}

NotFoundError wraps a generic 404 error.

func (NotFoundError) Error

func (e NotFoundError) Error() string

type RawHTTPStatusError

type RawHTTPStatusError struct {
	StatusCode  int
	RawResponse []byte
	RequestIDs  []string
}

RawHTTPStatusError represents any response with a 4xx or 5xx status code.

func (RawHTTPStatusError) Error

func (r RawHTTPStatusError) Error() string

type RequestError

type RequestError struct {
	Err error
}

RequestError represents a generic error encountered while performing the HTTP request. This generic error occurs before a HTTP response is obtained.

func (RequestError) Error

func (e RequestError) Error() string

type ResourceNotFoundError

type ResourceNotFoundError struct {
	Message string
}

ResourceNotFoundError is returned when the client requests a resource that does not exist or does not have permissions to see.

func (ResourceNotFoundError) Error

func (e ResourceNotFoundError) Error() string

type Response

type Response struct {
	// Result represents the resource entity type that is expected in the
	// response JSON.
	Result interface{}

	// RawResponse represents the response body.
	RawResponse []byte

	// Warnings represents warnings parsed from the custom warnings headers of a
	// Cloud Controller response.
	Warnings []string

	// HTTPResponse represents the HTTP response object.
	HTTPResponse *http.Response
}

Response represents a Cloud Controller response object.

type SSLValidationHostnameError

type SSLValidationHostnameError struct {
	Message string
}

SSLValidationHostnameError replaces x509.HostnameError when the server has SSL certificate that does not match the hostname.

func (SSLValidationHostnameError) Error

type ServiceUnavailableError

type ServiceUnavailableError struct {
	Message string
}

ServiceUnavailableError wraps a http 503 error.

func (ServiceUnavailableError) Error

func (e ServiceUnavailableError) Error() string

type UnauthorizedError

type UnauthorizedError struct {
	Message string
}

UnauthorizedError is returned when the client does not have the correct permissions to execute the request.

func (UnauthorizedError) Error

func (e UnauthorizedError) Error() string

type UnknownObjectInListError

type UnknownObjectInListError struct {
	Expected   interface{}
	Unexpected interface{}
}

UnknownObjectInListError is returned when iterating through a paginated list. Assuming tests are written for the paginated function, this should be impossible to get.

func (UnknownObjectInListError) Error

func (e UnknownObjectInListError) Error() string

type UnprocessableEntityError

type UnprocessableEntityError struct {
	Message string
}

UnprocessableEntityError is returned when the request cannot be processed by the cloud controller.

func (UnprocessableEntityError) Error

func (e UnprocessableEntityError) Error() string

type UnverifiedServerError

type UnverifiedServerError struct {
	URL string
}

UnverifiedServerError replaces x509.UnknownAuthorityError when the server has SSL but the client is unable to verify it's certificate

func (UnverifiedServerError) Error

func (e UnverifiedServerError) Error() string

Directories

Path Synopsis
Package ccv2 represents a Cloud Controller V2 client.
Package ccv2 represents a Cloud Controller V2 client.
ccv2fakes
This file was generated by counterfeiter
This file was generated by counterfeiter
Package ccv3 represents a Cloud Controller V3 client.
Package ccv3 represents a Cloud Controller V3 client.
ccv3fakes
This file was generated by counterfeiter
This file was generated by counterfeiter
This file was generated by counterfeiter
This file was generated by counterfeiter
wrapperfakes
This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter
This file was generated by counterfeiter This file was generated by counterfeiter This file was generated by counterfeiter

Jump to

Keyboard shortcuts

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