utils

package
v0.0.0-...-a602bb6 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2025 License: Apache-2.0, BSD-2-Clause-Views, BSD-3-Clause, + 1 more Imports: 7 Imported by: 13 modules, 35 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CollectHeadersToLog

func CollectHeadersToLog(headerGroups ...[]string) []string

CollectHeadersToLog returns an ordered slice of slices of headers to be logged and returns a unique, ordered slice of headers to be logged

func NewProxyResponseWriter

func NewProxyResponseWriter(w http.ResponseWriter) *proxyResponseWriter

func ReadResponseWithTimeout

func ReadResponseWithTimeout(r *bufio.Reader, req *http.Request, timeout time.Duration) (*http.Response, error)

ReadResponseWithTimeout extends http.ReadResponse but it utilizes a timeout

func TLSConfigWithServerName

func TLSConfigWithServerName(newServerName string, template *tls.Config, isRouteService bool) *tls.Config

Types

type AddHeaderIfNotPresentRewriter

type AddHeaderIfNotPresentRewriter struct {
	Header http.Header
}

AddHeaderIfNotPresentRewriter: 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

func (*AddHeaderIfNotPresentRewriter) RewriteHeader

func (i *AddHeaderIfNotPresentRewriter) RewriteHeader(header http.Header)

type HeaderRewriter

type HeaderRewriter interface {
	RewriteHeader(http.Header)
}

type ProxyResponseWriter

type ProxyResponseWriter interface {
	Header() http.Header
	Hijack() (net.Conn, *bufio.ReadWriter, error)
	Write(b []byte) (int, error)
	WriteHeader(s int)
	Done()
	Flush()
	Status() int
	SetStatus(status int)
	Size() int
	AddHeaderRewriter(HeaderRewriter)
}

type ReadResponseResult

type ReadResponseResult struct {
	// contains filtered or unexported fields
}

type RemoveHeaderRewriter

type RemoveHeaderRewriter struct {
	Header http.Header
}

RemoveHeaderRewriter: Removes any value associated to a header The http.Header must be built using the method Add() to canonalize the keys

func (*RemoveHeaderRewriter) RewriteHeader

func (i *RemoveHeaderRewriter) RewriteHeader(header http.Header)

type TimeoutError

type TimeoutError struct{}

func (TimeoutError) Error

func (t TimeoutError) Error() string

Jump to

Keyboard shortcuts

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