{"modulePath":"code.cloudfoundry.org/gorouter","version":"v0.0.0-20250429140807-a602bb6a6243","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package utils\n\n## Functions\n\n```go\nfunc CollectHeadersToLog(headerGroups ...[]string) []string\n```\nCollectHeadersToLog returns an ordered slice of slices of headers to be logged and returns a unique, ordered slice of headers to be logged\n\n```go\nfunc NewProxyResponseWriter(w http.ResponseWriter) *proxyResponseWriter\n```\n\n```go\nfunc ReadResponseWithTimeout(r *bufio.Reader, req *http.Request, timeout time.Duration) (*http.Response, error)\n```\nReadResponseWithTimeout extends http.ReadResponse but it utilizes a timeout\n\n```go\nfunc TLSConfigWithServerName(newServerName string, template *tls.Config, isRouteService bool) *tls.Config\n```\n\n## Types\n\n```go\ntype AddHeaderIfNotPresentRewriter struct {\n\tHeader http.Header\n}\n```\nAddHeaderIfNotPresentRewriter: Adds headers only if they are not present in the current http.Header. The http.Header must be built using the method Add() to canonalize the keys\n\n```go\nfunc (i *AddHeaderIfNotPresentRewriter) RewriteHeader(header http.Header)\n```\n\n```go\ntype HeaderRewriter interface {\n\tRewriteHeader(http.Header)\n}\n```\n\n```go\ntype ProxyResponseWriter interface {\n\tHeader() http.Header\n\tHijack() (net.Conn, *bufio.ReadWriter, error)\n\tWrite(b []byte) (int, error)\n\tWriteHeader(s int)\n\tDone()\n\tFlush()\n\tStatus() int\n\tSetStatus(status int)\n\tSize() int\n\tAddHeaderRewriter(HeaderRewriter)\n}\n```\n\n```go\ntype ReadResponseResult struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\ntype RemoveHeaderRewriter struct {\n\tHeader http.Header\n}\n```\nRemoveHeaderRewriter: Removes any value associated to a header The http.Header must be built using the method Add() to canonalize the keys\n\n```go\nfunc (i *RemoveHeaderRewriter) RewriteHeader(header http.Header)\n```\n\n```go\ntype TimeoutError struct{}\n```\n\n```go\nfunc (t TimeoutError) Error() string\n```\n\n","path":"code.cloudfoundry.org/gorouter/proxy/utils","name":"utils","synopsis":"","isRedistributable":true}
