middlewares

package
v1.15.1 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: Apache-2.0 Imports: 15 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewOauthTransport added in v1.15.0

func NewOauthTransport(clientID, clientSecret, tokenURL string, scopes ...string) *oauthConfig

func NewTracedTransport

func NewTracedTransport(config TraceConfig) *traceTransport

func SanitizeHeaders

func SanitizeHeaders(headers http.Header, redactedHeaders ...string) http.Header

Types

type RoundTripperFunc added in v1.15.0

type RoundTripperFunc func(*http.Request) (*http.Response, error)

func (RoundTripperFunc) RoundTrip added in v1.15.0

func (f RoundTripperFunc) RoundTrip(req *http.Request) (*http.Response, error)

type TraceConfig added in v1.15.0

type TraceConfig struct {
	// SpanName is an optional name for the span.
	// If not provided, the hostname of the requesting URL will be used.
	SpanName string

	// A list of patterns for headers which should be redacted in the trace.
	RedactedHeaders []string

	// MaxBodyLength is the max size of the body, in bytes, that will be traced.
	// If the response body is larger than this, it will not be traced at all.
	//
	//  Default: 4096 (4MB)
	MaxBodyLength int64

	// Body controls whether the request Body is traced
	Body bool

	// Response controls whether the Response body is traced
	Response bool

	// ResponseHeaders controls whether the response headers are traced
	ResponseHeaders bool

	// QueryParam controls whether the query parameters are traced
	QueryParam bool

	// Headers controls whether the Headers are traced
	Headers bool
}

Jump to

Keyboard shortcuts

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