Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleLogin ¶
HandleLogin returns a handler that implements logging into the application.
func HandleLogout ¶
func HandleLogout(w http.ResponseWriter, _ *http.Request)
HandleLogout handles logging out of the application. NOTE: This is not yet implemented.
Types ¶
type Middleware ¶
type Middleware struct {
// contains filtered or unexported fields
}
Middleware is a wrapper around a http.Handler that contains a pointer to the database connection.
func WithAuth ¶
func WithAuth(h http.Handler, d *storage.Database, root string, redirector Redirector) Middleware
WithAuth returns a Middleware that checks authentication before forwarding requests to the given handler.
func (Middleware) ServeHTTP ¶
func (m Middleware) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP implements the http.Handler interface and checks authentication on each request.
type Redirector ¶
type Redirector = func(http.ResponseWriter, *http.Request)
Redirector is the type of a custom HTTP handler to be called upon failed cookie verification.
Click to show internal directories.
Click to hide internal directories.