Documentation ¶
Overview ¶
Package http handles everything related to HTTP.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Error ¶
func Error(w http.ResponseWriter, err error, code int)
Error writes an error message to the response.
func ListenAndServe ¶
ListenAndServe is a wrapper for http.ListenAndServe.
func ServeAutoCert ¶
ServeAutoCert will serve on the standard TLS port (443) with LetsEncrypt certificates for the provided domain or domains. Certificates will be stored in the given cache directory. Incoming traffic on port 80 will be automatically forwared to 443.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler serves various HTTP endpoints.
func NewHandler ¶
NewHandler creates a new HTTP handler with the given options and initializes all routes.
type Option ¶
type Option func(h *Handler)
Option controls some aspects of the Handler.
func WithDatabase ¶
WithDatabase returns an options function for setting the handler's database backend.
func WithDevMode ¶
func WithPlausible ¶
func WithStationService ¶
func WithStationService(s browser.StationService) Option
WithStationService returns an option function for setting the handlers's stationService.