Documentation
¶
Index ¶
- Variables
- func Recovery() func(http.ResponseWriter, *http.Request, []string) bool
- type CORSConfig
- func (c *CORSConfig) Credentials(allow bool) *CORSConfig
- func (c *CORSConfig) Enable() *CORSConfig
- func (c *CORSConfig) Headers(headers ...string) *CORSConfig
- func (c *CORSConfig) MaxAge(seconds int) *CORSConfig
- func (c *CORSConfig) Methods(methods ...string) *CORSConfig
- func (c *CORSConfig) Origin(origins ...string) *CORSConfig
- type Router
- func (r *Router) All(pattern string, handler func(http.ResponseWriter, *http.Request, []string))
- func (r *Router) DELETE(pattern string, handler func(http.ResponseWriter, *http.Request, []string))
- func (r *Router) GET(pattern string, handler func(http.ResponseWriter, *http.Request, []string))
- func (r *Router) HEAD(pattern string, handler func(http.ResponseWriter, *http.Request, []string))
- func (r *Router) Handle(method, pattern string, ...)
- func (r *Router) ListenAndServe(addr string) error
- func (r *Router) ListenAndServeTLS(addr, certFile, keyFile string) error
- func (r *Router) Medium(mw func(http.ResponseWriter, *http.Request, []string) bool)
- func (r *Router) OPTIONS(pattern string, handler func(http.ResponseWriter, *http.Request, []string))
- func (r *Router) Option(pattern string) *CORSConfig
- func (r *Router) PATCH(pattern string, handler func(http.ResponseWriter, *http.Request, []string))
- func (r *Router) POST(pattern string, handler func(http.ResponseWriter, *http.Request, []string))
- func (r *Router) PUT(pattern string, handler func(http.ResponseWriter, *http.Request, []string))
- func (r *Router) ServeHTTP(w http.ResponseWriter, req *http.Request)
- func (r *Router) Static(pattern, root string)
- func (r *Router) Sub(prefix string) *Router
- type Type
Constants ¶
This section is empty.
Variables ¶
View Source
var MethodNotAllowed func(http.ResponseWriter, *http.Request, []string) = methodNotAllowed
View Source
var NotFound func(http.ResponseWriter, *http.Request, []string) = notFound
Functions ¶
Types ¶
type CORSConfig ¶
type CORSConfig struct {
// contains filtered or unexported fields
}
func (*CORSConfig) Credentials ¶
func (c *CORSConfig) Credentials(allow bool) *CORSConfig
func (*CORSConfig) Enable ¶
func (c *CORSConfig) Enable() *CORSConfig
func (*CORSConfig) Headers ¶
func (c *CORSConfig) Headers(headers ...string) *CORSConfig
func (*CORSConfig) MaxAge ¶
func (c *CORSConfig) MaxAge(seconds int) *CORSConfig
func (*CORSConfig) Methods ¶
func (c *CORSConfig) Methods(methods ...string) *CORSConfig
func (*CORSConfig) Origin ¶
func (c *CORSConfig) Origin(origins ...string) *CORSConfig
type Router ¶
type Router struct {
Recover bool
// contains filtered or unexported fields
}
func NewRecovery ¶
func NewRecovery() *Router
func (*Router) ListenAndServe ¶
func (*Router) ListenAndServeTLS ¶
func (*Router) Option ¶
func (r *Router) Option(pattern string) *CORSConfig
Click to show internal directories.
Click to hide internal directories.