Documentation ¶
Index ¶
- type HTTPError
- type Request
- func (r *Request) AccessLog(l *slog.Logger)
- func (r *Request) AddTracer()
- func (r *Request) HashHeader() string
- func (r *Request) Header() http.Header
- func (r *Request) PanicHandler(serveError bool)
- func (r *Request) Tracer() *tracing.Trace
- func (r *Request) Uint64Header(h string) uint64
- func (r *Request) Write(data []byte) (n int, err error)
- func (r *Request) WriteHeader(h int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPError ¶
func (*HTTPError) ServeError ¶
func (h *HTTPError) ServeError(w http.ResponseWriter)
type Request ¶
type Request struct { Context context.Context ID uint64 Request *http.Request Log *slog.Logger // contains filtered or unexported fields }
func (*Request) HashHeader ¶
Returns a validated Hash header from the Request.
func (*Request) PanicHandler ¶
Panic 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.
If 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.
func (*Request) Uint64Header ¶
Gets 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.
func (*Request) WriteHeader ¶
Writes a status code to to the caller.
Click to show internal directories.
Click to hide internal directories.