Documentation
¶
Overview ¶
Package router is a GoLang library that interacts with CloudFoundry Go Router
Package router contains utilities to make call to the router API
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a client that can be used to talk to a Cloud Controller's V2 Endpoints.
func NewClient ¶
func NewClient(config Config, wrappers []ConnectionWrapper) *Client
NewClient returns a new Router Client.
func (*Client) GetRouterGroupsByName ¶
func (client *Client) GetRouterGroupsByName(name string) ([]RouterGroup, error)
GetRouterGroupsByName returns a list of RouterGroups
func (*Client) SetupResources ¶
func (client *Client) SetupResources(URL string, connectionConfig ConnectionConfig) error
SetupResources configures the client to use the bootstrapURL
func (*Client) WrapConnection ¶
func (client *Client) WrapConnection(wrapper ConnectionWrapper)
WrapConnection wraps the current Client connection in the wrapper.
type Config ¶
type Config struct {
// AppName is the name of the application/process using the client.
AppName string
// AppVersion is the version of the application/process using the client.
AppVersion string
// Wrappers that apply to the client connection.
Wrappers []ConnectionWrapper
}
Config allows the Client to be configured
type Connection ¶
Connection creates and executes http requests
type ConnectionConfig ¶
ConnectionConfig is for configuring the RouterConnection
type ConnectionWrapper ¶
type ConnectionWrapper interface {
Connection
Wrap(innerconnection Connection) Connection
}
ConnectionWrapper can wrap a given connection allowing the wrapper to modify all requests going in and out of the given connection.
type Pipebomb ¶
type Pipebomb struct {
io.ReadCloser
}
Pipebomb is a wrapper around an io.Pipe's io.ReadCloser that turns it into a ReadSeeker that errors on Seek calls. This is designed to prevent the caller from rereading the body multiple times.
func NewPipeBomb ¶
func NewPipeBomb() (*Pipebomb, io.WriteCloser)
NewPipeBomb returns an io.WriteCloser that can be used to stream data to a the Pipebomb.
type Request ¶
Request represents the request of the router
func NewRequest ¶
func NewRequest(request *http.Request, body io.ReadSeeker) *Request
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
// HTTPResponse represents the HTTP response object.
HTTPResponse *http.Response
}
Response represents a Router response object.
type RouterConnection ¶
RouterConnection represents the connection to Router
func NewConnection ¶
func NewConnection(config ConnectionConfig) *RouterConnection
NewConnection returns a pointer to a new RouterConnection with the provided configuration
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
|
wrapperfakes
Code generated by counterfeiter.
|
Code generated by counterfeiter. |