Documentation ¶
Overview ¶
Package http handles HTTP requests.
Index ¶
- Variables
- func ErrorInvalidQuery(w http.ResponseWriter, r *http.Request)
- func Errorf(w http.ResponseWriter, r *http.Request, code int, format string, a ...any)
- func FromJSON(w http.ResponseWriter, r *http.Request, v any) error
- func New(pg postgres.Postgres) *server
- func ParseIntQuery(r *http.Request, v string) (int, error)
- func ToJSON(w http.ResponseWriter, v any, code int) error
- type WrapError
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrMalformedAuthHeader = errors.New("malformed authorization header")
ErrMalformedAuthHeader returned when authorization header is not formatted properly.
Functions ¶
func ErrorInvalidQuery ¶
func ErrorInvalidQuery(w http.ResponseWriter, r *http.Request)
ErrorInvalidQuery uese Error to reports invalid url quries.
func ParseIntQuery ¶
ParseIntQuery parses integer url parameter, returns nothing when parameter is not provided.
Types ¶
Click to show internal directories.
Click to hide internal directories.