{"modulePath":"github.com/liquidgecka/blobby","version":"v0.0.0-20261108055455-e9a390ceacc7","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package request\n\n## Functions\n\n```go\nfunc Put(r *Request)\n```\nPut cleans up and returns a Request to the pool.\n\n## Types\n\n```go\ntype HTTPError struct {\n\tStatus   int\n\tResponse string\n\tErr      error\n}\n```\n\n```go\nfunc (h *HTTPError) Error() string\n```\n\n```go\nfunc (h *HTTPError) ServeError(w http.ResponseWriter)\n```\n\n```go\ntype Request struct {\n\tContext context.Context\n\tID      uint64\n\tRequest *http.Request\n\n\tLog *slog.Logger\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc Get(\n\tw http.ResponseWriter,\n\treq *http.Request,\n\tl *slog.Logger,\n) *Request\n```\nGet acquires a Request from the pool and initializes it.\n\n```go\nfunc New(\n\tw http.ResponseWriter,\n\treq *http.Request,\n\tl *slog.Logger,\n) (\n\tr Request,\n)\n```\n\n```go\nfunc (r *Request) AccessLog(l *slog.Logger)\n```\nLogs the access log for this request to the given logger.\n\n```go\nfunc (r *Request) AddTracer()\n```\nEnables tracing on this Request.\n\n```go\nfunc (r *Request) HashHeader() string\n```\nReturns a validated Hash header from the Request.\n\n```go\nfunc (r *Request) Header() http.Header\n```\nReturns the underlying response headers to the caller.\n\n```go\nfunc (r *Request) Logger() *slog.Logger\n```\nLogger returns the logger enriched with the request ID, instantiating it lazily if it has not yet been initialized.\n\n```go\nfunc (r *Request) PanicHandler(serveError bool)\n```\nPanic handler. This can be called in a defer from the main request handler in order to catch and return panics raised as part of event flow processing.\n\nIf a panic is received then this will sent a HTTP response to the caller indicating what type of error was received (if HTTPError) or a 500 indicating that a completely unexpected error happened during the request processing cycle.\n\n```go\nfunc (r *Request) Tracer() *tracing.Trace\n```\nReturns the tracer set using AddTracer()\n\n```go\nfunc (r *Request) Uint64Header(h string) uint64\n```\nGets a header that is expected to be a uint64 value, returning an error if the header is either not present, or can not be parsed into a uint64 value.\n\n```go\nfunc (r *Request) Write(data []byte) (n int, err error)\n```\nWrites data to the caller.\n\n```go\nfunc (r *Request) WriteHeader(h int)\n```\nWrites a status code to to the caller.\n\n","path":"github.com/liquidgecka/blobby/httpserver/request","name":"request","synopsis":"","isRedistributable":true}
