Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handlers ¶
Handlers have some common functions for the http handlers
func (*Handlers) NTPHandler ¶
func (h *Handlers) NTPHandler(w http.ResponseWriter, req *http.Request)
NTPHandler implements GET /ntp/{ip}
func (*Handlers) TracerouteHandler ¶
func (h *Handlers) TracerouteHandler(w http.ResponseWriter, req *http.Request)
GET /traceroute/{ip}
type RateHandler ¶
type RateHandler struct {
// contains filtered or unexported fields
}
RateHandler wraps a handler in rate limiting
func NewRateHandler ¶
func NewRateHandler(h http.Handler, limiter Limiter) *RateHandler
NewRateHandler returns h wrapped in the Limiter
func (*RateHandler) CheckQueue ¶
func (rh *RateHandler) CheckQueue(w http.ResponseWriter, req *http.Request)
func (*RateHandler) ServeHTTP ¶
func (rh *RateHandler) ServeHTTP(w http.ResponseWriter, req *http.Request)
ServeHTTP implements http.Server interface
func (*RateHandler) Wrap ¶
func (rh *RateHandler) Wrap(wrapped http.HandlerFunc) http.HandlerFunc
Click to show internal directories.
Click to hide internal directories.