Documentation ¶
Overview ¶
Package http provides a set of utilities for handling HTTP requests and responses within the GoFr framework.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Metrics ¶ added in v0.3.0
type Metrics interface { IncrementCounter(ctx context.Context, name string, labels ...string) DeltaUpDownCounter(ctx context.Context, name string, value float64, labels ...string) RecordHistogram(ctx context.Context, name string, value float64, labels ...string) SetGauge(name string, value float64) }
Metrics represents an interface for registering the default metrics in GoFr framework.
type Request ¶
type Request struct {
// contains filtered or unexported fields
}
Request is an abstraction over the underlying http.Request. This abstraction is useful because it allows us to create applications without being aware of the transport. cmd.Request is another such abstraction.
func NewRequest ¶
NewRequest creates a new GoFr Request instance from the given http.Request.
type Responder ¶
type Responder struct {
// contains filtered or unexported fields
}
Responder encapsulates an http.ResponseWriter and is responsible for crafting structured responses.
func NewResponder ¶
func NewResponder(w http.ResponseWriter) *Responder
NewResponder creates a new Responder instance from the given http.ResponseWriter..
func (Responder) HTTPStatusFromError ¶
HTTPStatusFromError maps errors to HTTP status codes.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package middleware provides a collection of middleware functions that handles various aspects of request handling, such as authentication, logging, tracing, and metrics collection.
|
Package middleware provides a collection of middleware functions that handles various aspects of request handling, such as authentication, logging, tracing, and metrics collection. |