Documentation
¶
Overview ¶
Package httpserver provides HTTP server construction helpers for the gateway.
Index ¶
Constants ¶
View Source
const ( ServerReadTimeout = 30 * time.Second ServerReadHeaderTimeout = 10 * time.Second ServerWriteTimeout = 120 * time.Second ServerIdleTimeout = 60 * time.Second ServerMaxHeaderBytes = 1 << 20 // 1 MiB )
Default HTTP server timeouts and limits.
Variables ¶
This section is empty.
Functions ¶
func CloseResources ¶
func CloseResources(resources ...NamedResource) error
CloseResources closes every resource that implements io.Closer, joining any errors. It always closes the shared HTTP client idle connections last.
func NewRouter ¶
func NewRouter( registry *providers.Registry, keyStore admin.Store, corsOrigins []string, gw *aigateway.Gateway, cfgManager admin.ConfigManager, rlStore *ratelimit.Store, logReader requestlog.Reader, logMaintainer requestlog.Maintainer, masterKey string, ) http.Handler
NewRouter builds the HTTP router for the gateway.
Types ¶
type ConnMetadata ¶
ConnMetadata holds per-connection observability data stored in the request context.
func ConnMetadataFromContext ¶
func ConnMetadataFromContext(ctx context.Context) (ConnMetadata, bool)
ConnMetadataFromContext extracts connection metadata stored by ConnContext.
type NamedResource ¶
NamedResource pairs a human-readable name with a closeable value so that close errors can be reported with context.
Click to show internal directories.
Click to hide internal directories.