Documentation ¶
Overview ¶
Package http handles http requests for the autoupate service.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Autoupdate ¶
func Autoupdate(mux *http.ServeMux, auth Authenticater, connecter Connecter, metric RequestMetricer)
Autoupdate builds the requested keys from the body of a request. The body has to be in the format specified in the keysbuilder package.
func MetricRequest ¶
func MetricRequest(mux *http.ServeMux, metric RequestMetricer)
MetricRequest returns the request metrics.
Types ¶
type Authenticater ¶
type Authenticater interface { Authenticate(http.ResponseWriter, *http.Request) (context.Context, error) FromContext(context.Context) int }
Authenticater gives an user id for an request. Returns 0 for anonymous.
type ClientError ¶
ClientError is an expected error that are returned to the client.
type Connecter ¶
type Connecter interface {
Connect(userID int, kb autoupdate.KeysBuilder) autoupdate.DataProvider
}
Connecter returns an connect object.
Click to show internal directories.
Click to hide internal directories.