Documentation
¶
Index ¶
Constants ¶
View Source
const (
PollTime time.Duration = 100 * time.Microsecond
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler interface {
ServeTCP(ResponseWriter, *Request)
}
type HandlerFunc ¶
type HandlerFunc func(ResponseWriter, *Request)
func (HandlerFunc) ServeTCP ¶
func (f HandlerFunc) ServeTCP(w ResponseWriter, r *Request)
type Limiter ¶
func NewLimiter ¶
type MiddlewareFunc ¶
func (MiddlewareFunc) Middleware ¶
func (mw MiddlewareFunc) Middleware(handler Handler) Handler
type ResponseWriter ¶
type Route ¶
type Route struct {
// contains filtered or unexported fields
}
func (*Route) HandleFunc ¶
func (r *Route) HandleFunc(f func(ResponseWriter, *Request)) *Route
type Router ¶
type Router struct {
// TODO: MaxConnections is the number of incoming connections the server can
// handle. It is used to calculate the connection pool size.
MaxConnections int32
// TODO: Basecontext is unused in the router implementation. It was added to
// mimic the server struct.
BaseContext context.Context
// TODO: ReadTimeout is unused in the router implementation. It was added to
// mimic the server struct.
ReadTimeout time.Duration
// contains filtered or unexported fields
}
func (*Router) HandleFunc ¶
func (rt *Router) HandleFunc(f func(w ResponseWriter, r *Request)) *Route
func (*Router) ServeTCP ¶
func (rt *Router) ServeTCP(w ResponseWriter, r *Request)
func (*Router) Use ¶
func (rt *Router) Use(mwf ...MiddlewareFunc)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.