Documentation
¶
Index ¶
- type LogEntry
- type WebController
- func (web *WebController) BasicAuth(handler http.HandlerFunc, username, password, realm string) http.HandlerFunc
- func (web *WebController) CtxMiddleware(next http.Handler) http.Handler
- func (web *WebController) Log(entry LogEntry)
- func (web *WebController) LogFromRequest(crw *contextResponseWriter, r *http.Request, rt int)
- func (web *WebController) LoggingMiddleware(next http.Handler) http.Handler
- func (web *WebController) Start()
- func (web *WebController) Stop()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type WebController ¶
type WebController struct {
// contains filtered or unexported fields
}
func NewController ¶
func (*WebController) BasicAuth ¶
func (web *WebController) BasicAuth(handler http.HandlerFunc, username, password, realm string) http.HandlerFunc
BasicAuth wraps a handler requiring HTTP basic auth for it using the given username and password and the specified realm, which shouldn't contain quotes.
Most web browser display a dialog with something like:
The website says: "<realm>"
Which is really stupid so you may want to set the realm to a message rather than an actual realm.
func (*WebController) CtxMiddleware ¶
func (web *WebController) CtxMiddleware(next http.Handler) http.Handler
add ctx to pass things to logging
func (*WebController) Log ¶
func (web *WebController) Log(entry LogEntry)
func (*WebController) LogFromRequest ¶
func (web *WebController) LogFromRequest(crw *contextResponseWriter, r *http.Request, rt int)
func (*WebController) LoggingMiddleware ¶
func (web *WebController) LoggingMiddleware(next http.Handler) http.Handler
simple logging
func (*WebController) Start ¶
func (web *WebController) Start()
func (*WebController) Stop ¶
func (web *WebController) Stop()
Click to show internal directories.
Click to hide internal directories.