Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chain ¶ added in v0.4.0
type Chain struct {
// contains filtered or unexported fields
}
Chain represents a chain of middlewares.
func NewChain ¶ added in v0.4.0
func NewChain(mws ...Middleware) Chain
NewChain creates a new Chain with the provided middlewares.
func (Chain) Append ¶ added in v0.4.0
func (c Chain) Append(mws ...Middleware) Chain
Append appends the provided middlewares to the chain.
type Middleware ¶ added in v0.4.0
Middleware is a function that takes a http.Handler and returns a http.Handler
type Router ¶
type Router struct { NotFound http.Handler MethodNotAllowed http.Handler // contains filtered or unexported fields }
Router represents a multiplexer that routes incoming HTTP requests.
func New ¶
New creates a new instance of the Router struct. It initializes the mux field with a new instance of http.ServeMux. Returns a pointer to the newly created Router.
func (*Router) Group ¶ added in v0.5.0
Group creates a new sub-router with the given path appended to the base path of the parent router.
func (*Router) HandleFunc ¶ added in v0.3.0
func (r *Router) HandleFunc(pattern string, handler http.HandlerFunc)
HandleFunc adds a new route with the given pattern and handler function.