Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SingleLineRequestLogger ¶
Types ¶
type Handler ¶
type Handler struct {
Upstream http.Handler
// LogRequest will be called after an upstream request has been handled,
// for example SingleLineLogger.
LogRequest func(statusCode int, r *http.Request, duration time.Duration)
// LogSlowResponse should return a channel which will be closed when the
// response headers for the corresponding request are sent.
// See SlowResponseLogger for instance.
LogSlowResponse func(r *http.Request) chan<- struct{}
// contains filtered or unexported fields
}
func (*Handler) ForwardMessages ¶
func (h *Handler) ForwardMessages(messages <-chan string, initialRefreshDelay, minRefreshInterval time.Duration)
ForwardMessages forwards messages to the webpage, to trigger a reload. The method returns when messages is closed. If initialRefreshDelay is set (5ms for instance), it will delay the first message forwarding (in case of initial message burst). If minRefreshInterval is set (1s for instance), it will delay further message forwarding. (in case of repeated messages).
Click to show internal directories.
Click to hide internal directories.