Documentation ¶
Index ¶
- func BasicAuth(accounts Accounts) http.HandlerFunc
- func BasicAuthForRealm(accounts Accounts, realm string) http.HandlerFunc
- func Stop(r *http.Request)
- func Stopped(r *http.Request) bool
- type Accounts
- type Handlers
- type Mux
- func (mux *Mux) After(handler func(w http.ResponseWriter, r *http.Request))
- func (mux *Mux) Before(handler func(w http.ResponseWriter, r *http.Request))
- func (mux *Mux) Handle(pattern string, handlers ...http.Handler)
- func (mux *Mux) HandleFunc(pattern string, handlerFuns ...func(http.ResponseWriter, *http.Request))
- func (mux *Mux) Recover(handler func(w http.ResponseWriter, r *http.Request))
- func (mux *Mux) ServeHTTP(w http.ResponseWriter, r *http.Request)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BasicAuth ¶
func BasicAuth(accounts Accounts) http.HandlerFunc
BasicAuth returns a Basic HTTP Authorization middleware. It takes as argument a map[string]string where the key is the user name and the value is the password.
func BasicAuthForRealm ¶
func BasicAuthForRealm(accounts Accounts, realm string) http.HandlerFunc
BasicAuthForRealm returns a Basic HTTP Authorization middleware. It takes as arguments a map[string]string where the key is the user name and the value is the password, as well as the name of the Realm. If the realm is empty, "Authorization Required" will be used by default. (see http://tools.ietf.org/html/rfc2617#section-1.2)
Types ¶
type Mux ¶
Mux is an HTTP request multiplexer.
func (*Mux) After ¶
func (mux *Mux) After(handler func(w http.ResponseWriter, r *http.Request))
After set the handler after all handlers.
func (*Mux) Before ¶
func (mux *Mux) Before(handler func(w http.ResponseWriter, r *http.Request))
Before set the handler before all handlers.
func (*Mux) Handle ¶
Handle registers the handler for the given pattern. If a handler already exists for pattern, Handle panics.
func (*Mux) HandleFunc ¶
HandleFunc registers the handler function for the given pattern.