{"modulePath":"github.com/cloudfoundry/cli","version":"v7.1.0+incompatible","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package wrapper\n\n## Types\n\n```go\ntype RequestLogger struct {\n\t// contains filtered or unexported fields\n}\n```\nRequestLogger is the wrapper that logs requests to and responses from the UAA server\n\n```go\nfunc NewRequestLogger(output RequestLoggerOutput) *RequestLogger\n```\nNewRequestLogger returns a pointer to a RequestLogger wrapper\n\n```go\nfunc (logger *RequestLogger) Make(request *http.Request, passedResponse *uaa.Response) error\n```\nMake records the request and the response to UI\n\n```go\nfunc (logger *RequestLogger) Wrap(innerconnection uaa.Connection) uaa.Connection\n```\nWrap sets the connection on the RequestLogger and returns itself\n\n```go\ntype RequestLoggerOutput interface {\n\tDisplayBody(body []byte) error\n\tDisplayJSONBody(body []byte) error\n\tDisplayHeader(name string, value string) error\n\tDisplayHost(name string) error\n\tDisplayRequestHeader(method string, uri string, httpProtocol string) error\n\tDisplayResponseHeader(httpProtocol string, status string) error\n\tDisplayType(name string, requestDate time.Time) error\n\tHandleInternalError(err error)\n\tStart() error\n\tStop() error\n}\n```\nRequestLoggerOutput is the interface for displaying logs\n\n```go\ntype RetryRequest struct {\n\t// contains filtered or unexported fields\n}\n```\nRetryRequest is a wrapper that retries failed requests if they contain a 5XX status code.\n\n```go\nfunc NewRetryRequest(maxRetries int) *RetryRequest\n```\nNewRetryRequest returns a pointer to a RetryRequest wrapper.\n\n```go\nfunc (retry *RetryRequest) Make(request *http.Request, passedResponse *uaa.Response) error\n```\nMake retries the request if it comes back with a 5XX status code.\n\n```go\nfunc (retry *RetryRequest) Wrap(innerconnection uaa.Connection) uaa.Connection\n```\nWrap sets the connection in the RetryRequest and returns itself.\n\n```go\ntype TokenCache interface {\n\tAccessToken() string\n\tRefreshToken() string\n\tSetAccessToken(token string)\n\tSetRefreshToken(token string)\n}\n```\nTokenCache is where the UAA token information is stored.\n\n```go\ntype UAAAuthentication struct {\n\t// contains filtered or unexported fields\n}\n```\nUAAAuthentication wraps connections and adds authentication headers to all requests\n\n```go\nfunc NewUAAAuthentication(client UAAClient, cache TokenCache) *UAAAuthentication\n```\nNewUAAAuthentication returns a pointer to a UAAAuthentication wrapper with the client and token cache.\n\n```go\nfunc (t *UAAAuthentication) Make(request *http.Request, passedResponse *uaa.Response) error\n```\nMake adds authentication headers to the passed in request and then calls the wrapped connection's Make\n\n```go\nfunc (t *UAAAuthentication) SetClient(client UAAClient)\n```\nSetClient sets the UAA client that the wrapper will use.\n\n```go\nfunc (t *UAAAuthentication) Wrap(innerconnection uaa.Connection) uaa.Connection\n```\nWrap sets the connection on the UAAAuthentication and returns itself\n\n```go\ntype UAAClient interface {\n\tRefreshAccessToken(refreshToken string) (uaa.RefreshedTokens, error)\n}\n```\nUAAClient is the interface for getting a valid access token\n\n","path":"github.com/cloudfoundry/cli/api/uaa/wrapper","name":"wrapper","synopsis":"","isRedistributable":true}
