{"modulePath":"github.com/cloudfoundry/cli","version":"v7.1.0+incompatible","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package router\n\nPackage router is a GoLang library that interacts with CloudFoundry Go Router\n\nPackage router contains utilities to make call to the router API\n\n## Types\n\n```go\ntype Client struct {\n\t// contains filtered or unexported fields\n}\n```\nClient is a client that can be used to talk to a Cloud Controller's V2 Endpoints.\n\n```go\nfunc NewClient(config Config) *Client\n```\nNewClient returns a new Router Client.\n\n```go\nfunc (client *Client) GetRouterGroupByName(name string) (RouterGroup, error)\n```\nGetRouterGroupByName returns a list of RouterGroups.\n\n```go\nfunc (client *Client) GetRouterGroups() ([]RouterGroup, error)\n```\n\n```go\nfunc (client *Client) WrapConnection(wrapper ConnectionWrapper)\n```\nWrapConnection wraps the current Client connection in the wrapper.\n\n```go\ntype Config struct {\n\t// AppName is the name of the application/process using the client.\n\tAppName string\n\n\t// AppVersion is the version of the application/process using the client.\n\tAppVersion string\n\n\t// ConnectionConfig is the configuration for the client connection.\n\tConnectionConfig\n\n\t// RoutingEndpoint is the url of the router API.\n\tRoutingEndpoint string\n\n\t// Wrappers that apply to the client connection.\n\tWrappers []ConnectionWrapper\n}\n```\nConfig allows the Client to be configured\n\n```go\ntype Connection interface {\n\tMake(request *Request, passedResponse *Response) error\n}\n```\nConnection creates and executes http requests\n\n```go\ntype ConnectionConfig struct {\n\tDialTimeout       time.Duration\n\tSkipSSLValidation bool\n}\n```\nConnectionConfig is for configuring the RouterConnection\n\n```go\ntype ConnectionWrapper interface {\n\tConnection\n\tWrap(innerconnection Connection) Connection\n}\n```\nConnectionWrapper can wrap a given connection allowing the wrapper to modify all requests going in and out of the given connection.\n\n```go\ntype Params map[string]string\n```\nParams represents URI parameters for a request.\n\n```go\ntype Request struct {\n\t*http.Request\n\t// contains filtered or unexported fields\n}\n```\nRequest represents the request of the router\n\n```go\nfunc NewRequest(request *http.Request, body io.ReadSeeker) *Request\n```\n\n```go\nfunc (r *Request) ResetBody() error\n```\n\n```go\ntype Response struct {\n\t// Result represents the resource entity type that is expected in the\n\t// response JSON.\n\tResult interface{}\n\n\t// RawResponse represents the response body.\n\tRawResponse []byte\n\n\t// HTTPResponse represents the HTTP response object.\n\tHTTPResponse *http.Response\n}\n```\nResponse represents a Router response object.\n\n```go\ntype RouterConnection struct {\n\tHTTPClient *http.Client\n}\n```\nRouterConnection represents the connection to Router\n\n```go\nfunc NewConnection(config ConnectionConfig) *RouterConnection\n```\nNewConnection returns a pointer to a new RouterConnection with the provided configuration\n\n```go\nfunc (connection *RouterConnection) Make(request *Request, responseToPopulate *Response) error\n```\nMake performs the request and parses the response.\n\n```go\ntype RouterGroup struct {\n\tGUID            string `json:\"guid\"`\n\tName            string `json:\"name\"`\n\tReservablePorts string `json:\"reservable_ports\"`\n\tType            string `json:\"type\"`\n}\n```\nRouterGroup represents a router group.\n\n","path":"github.com/cloudfoundry/cli/api/router","name":"router","synopsis":"Package router is a GoLang library that interacts with CloudFoundry Go Router Package router contains utilities to make call to the router API","isRedistributable":true}
