request

package
v0.0.0-...-43b7830 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ShortRequestLogThreshold = time.Second * 5
	ListRequestLogThreshold  = time.Second * 30
)

Functions

func IsProxyForwarded

func IsProxyForwarded(ctx context.Context) bool

func LogThreshold

func LogThreshold(verb string) time.Duration

func SetFlowControl

func SetFlowControl(ctx context.Context, flowControl string) error

func SetProxyForwarded

func SetProxyForwarded(ctx context.Context, endpoint string) error

func SetProxyTerminated

func SetProxyTerminated(ctx context.Context, reason string) error

func WithExtraRequestInfo

func WithExtraRequestInfo(parent context.Context, info *ExtraRequestInfo) context.Context

WithExtraRequestInfo returns a copy of parent in which the ExtraRequestInfo value is set

func WithProxyInfo

func WithProxyInfo(parent context.Context, info *ProxyInfo) context.Context

WithProxyInfo returns a copy of parent in which the ProxyInfo value is set

Types

type ExtraRequestInfo

type ExtraRequestInfo struct {
	Scheme               string
	Hostname             string // hostname without port
	IsImpersonateRequest bool
	Impersonator         user.Info
	UpstreamCluster      *clusters.ClusterInfo
	IsProxyRequest       bool
}

func ExtraRequestInfoFrom

func ExtraRequestInfoFrom(ctx context.Context) (*ExtraRequestInfo, bool)

ExtraRequestInfoFrom returns the value of the ExtraRequestInfo key on the ctx

type ExtraRequestInfoFactory

type ExtraRequestInfoFactory struct{}

func (*ExtraRequestInfoFactory) NewExtraRequestInfo

func (f *ExtraRequestInfoFactory) NewExtraRequestInfo(req *http.Request) (*ExtraRequestInfo, error)

type ExtraRequestInfoResolver

type ExtraRequestInfoResolver interface {
	NewExtraRequestInfo(req *http.Request) (*ExtraRequestInfo, error)
}

type ProxyInfo

type ProxyInfo struct {
	Forwarded   bool
	Endpoint    string
	Reason      string
	FlowControl string
}

ProxyInfo contains information that indicates if the request is proxied

func ExtraProxyInfoFrom

func ExtraProxyInfoFrom(ctx context.Context) (*ProxyInfo, bool)

ExtraProxyInfoFrom returns the value of the ExtraRequestInfo key on the ctx

func NewProxyInfo

func NewProxyInfo() *ProxyInfo

Jump to

Keyboard shortcuts

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