Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JsonSender ¶
type JsonSender struct {
// contains filtered or unexported fields
}
func (*JsonSender) Send ¶
func (r *JsonSender) Send(ctx context.Context, w http.ResponseWriter, status int, body any)
Send returns a JSON response with the given status code and body. If marshalling fails, it will return a 500 response with the error message.
type Middeware ¶
type Middeware func(http.HandlerFunc) http.HandlerFunc
type Route ¶
type Route struct {
// contains filtered or unexported fields
}
func (*Route) WithMiddleware ¶
type Sender ¶
type Sender interface { // Send marshals the body and sends it as a response with the given status code. // If marshalling fails, it will return a 500 response with the error message. Send(ctx context.Context, w http.ResponseWriter, status int, body any) }
func NewJsonSender ¶
Click to show internal directories.
Click to hide internal directories.