Documentation
¶
Overview ¶
Package api serves HTTP. The server is a singleton with a lifecycle. A handler type covers one resource, with a method per route; it is Scoped when it needs the request, and built in the request scope the dihttp middleware opens, or a plain singleton when it does not.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Caller ¶
type Caller struct{ Name string }
Caller is who is making the request. It depends on the *http.Request, which only a request scope provides.
type Health ¶ added in v0.13.0
type Health struct {
// contains filtered or unexported fields
}
Health needs nothing from the request, so it is an ordinary singleton.
type Users ¶ added in v0.13.0
type Users struct {
// contains filtered or unexported fields
}
Users is built once per request, from singletons and request-scoped values alike, and serves every route about users.
Click to show internal directories.
Click to hide internal directories.