utils

package
v0.0.0-...-2ae1647 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: Apache-2.0, BSD-2-Clause-Views, BSD-3-Clause, + 1 more Imports: 7 Imported by: 28

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