Documentation
¶
Overview ¶
Package ingress mirrors inbound HTTP requests to reference and candidate services.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// Listen is the address for the ingress HTTP server.
Listen string `default:"127.0.0.1:50050" help:"Address for the ingress HTTP server."`
// Reference is the authoritative backend URL.
Reference string `required:"" help:"Reference backend URL using http, https, or h2c."`
// Candidate is the mirrored backend URL.
Candidate string `required:"" help:"Candidate backend URL using a literal loopback IP and http, https, or h2c."`
// CandidateTimeout limits the duration of a candidate request.
CandidateTimeout time.Duration `default:"30s" help:"Maximum duration of a candidate request."`
// CandidateMaxInFlight limits concurrent candidate requests.
CandidateMaxInFlight int `default:"64" help:"Maximum concurrent candidate requests before quarantine."`
// CandidateBufferBytes limits queued request data across all candidates.
CandidateBufferBytes int `default:"1048576" help:"Maximum request bytes buffered across candidates before quarantine."`
// MaxInFlightRequests limits concurrent ingress requests.
MaxInFlightRequests int `default:"256" help:"Maximum concurrent ingress requests."`
// MaxConnections limits concurrent client connections.
MaxConnections int `default:"512" help:"Maximum concurrent client connections."`
// ReadHeaderTimeout limits the duration spent reading request headers.
ReadHeaderTimeout time.Duration `default:"10s" help:"Maximum duration for reading request headers."`
// IdleTimeout limits how long an idle client connection remains open.
IdleTimeout time.Duration `default:"1m" help:"Maximum idle client connection duration."`
// MaxHeaderBytes limits the size of request headers.
MaxHeaderBytes int `default:"65536" help:"Maximum request header size in bytes."`
// ShutdownTimeout limits graceful server shutdown.
ShutdownTimeout time.Duration `default:"10s" help:"Maximum graceful shutdown duration."`
}
Config contains the command-line configuration for an ingress proxy.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler forwards requests to both backends and returns only the reference response.
func (*Handler) Serve ¶
Serve accepts ingress traffic until the context is cancelled or the server fails.
type Transport ¶
type Transport struct {
// contains filtered or unexported fields
}
Transport forwards HTTP/1, encrypted HTTP/2, and unencrypted HTTP/2 requests.
func NewTransport ¶
NewTransport constructs transports for HTTP/1, encrypted HTTP/2, and h2c.
func (*Transport) CloseIdleConnections ¶
func (t *Transport) CloseIdleConnections()
CloseIdleConnections closes idle connections held by both underlying transports.
Click to show internal directories.
Click to hide internal directories.