Documentation ¶
Index ¶
- Variables
- func Auth(ctx contract.Context)
- func New(app contract.Application) contract.HttpRouter
- func NewHttp(application contract.Application, request *http.Request, ...) contract.HttpProtocol
- func NewServer(app contract.Application, srvConfig map[string]interface{}) contract.Server
- func NewSession(store sessions.Store, request *http.Request, response http.ResponseWriter) contract.Session
- func NewWrapResponseWriter(responseWriter http.ResponseWriter) contract.HttpWrapResponseWriter
- func Recovery(ctx contract.Context)
- func Session(ctx contract.Context)
- type Command
- type Group
- func (g *Group) DELETE(path string, handler contract.ContextHandler) contract.HttpRoute
- func (g *Group) GET(path string, handler contract.ContextHandler) contract.HttpRoute
- func (g *Group) Group(prefix string) contract.HttpRouteGroup
- func (g *Group) Handler(method, path string, handler http.HandlerFunc)
- func (g *Group) OPTIONS(path string, handler contract.ContextHandler) contract.HttpRoute
- func (g *Group) PATCH(path string, handler contract.ContextHandler) contract.HttpRoute
- func (g *Group) POST(path string, handler contract.ContextHandler) contract.HttpRoute
- func (g *Group) PUT(path string, handler contract.ContextHandler) contract.HttpRoute
- func (g *Group) Prefix(prefix string) contract.HttpRouteGroup
- func (g *Group) Use(handlers ...contract.ContextHandler) contract.HttpRouteGroup
- type Http
- func (h *Http) Accept() []string
- func (h *Http) Application() contract.Application
- func (h *Http) ClientIP() string
- func (h *Http) Clone() contract.Protocol
- func (h *Http) ContentType() string
- func (h *Http) Cookie(name string) (string, error)
- func (h *Http) Header(key string) string
- func (h *Http) IsAccept(key string) bool
- func (h *Http) IsContentType(key string) bool
- func (h *Http) IsMethod(key string) bool
- func (h *Http) Message() ([]byte, error)
- func (h *Http) Metadata() map[string][]string
- func (*Http) Name() string
- func (h *Http) Param(key string) httprouter.Param
- func (h *Http) Params() []httprouter.Param
- func (h *Http) Read(p []byte) (n int, err error)
- func (h *Http) Redirect(status int, location string)
- func (h *Http) Request() *http.Request
- func (h *Http) ResponseWriter() contract.HttpWrapResponseWriter
- func (h *Http) Route() contract.HttpRoute
- func (h *Http) Session() contract.Session
- func (h *Http) SessionValue(key string) interface{}
- func (h *Http) SetCookie(cookie *http.Cookie)
- func (h *Http) SetHeader(key, value string)
- func (h *Http) SetParams(params []httprouter.Param)
- func (h *Http) SetRoute(route contract.HttpRoute)
- func (h *Http) SetSession(session contract.Session)
- func (h *Http) SetStatus(status int)
- func (h *Http) Values() map[string][]string
- func (h *Http) Write(bytes []byte) (int, error)
- type Provider
- type Route
- type Router
- func (r *Router) DELETE(path string, handler contract.ContextHandler) contract.HttpRoute
- func (r *Router) GET(path string, handler contract.ContextHandler) contract.HttpRoute
- func (r *Router) Group(prefix string) contract.HttpRouteGroup
- func (r *Router) Handler(method, path string, handler http.HandlerFunc)
- func (r *Router) HttpRouter() *httprouter.Router
- func (r *Router) NotFound(handler contract.ContextHandler) contract.HttpRouter
- func (r *Router) OPTIONS(path string, handler contract.ContextHandler) contract.HttpRoute
- func (r *Router) PATCH(path string, handler contract.ContextHandler) contract.HttpRoute
- func (r *Router) POST(path string, handler contract.ContextHandler) contract.HttpRoute
- func (r *Router) PUT(path string, handler contract.ContextHandler) contract.HttpRoute
- func (r *Router) ServeHTTP(w http.ResponseWriter, req *http.Request)
- func (r *Router) Static(path string, root string) contract.HttpRouter
- type Server
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultConfig = map[string]interface{}{ `host`: `0.0.0.0:80`, `read-timeout`: time.Minute, `write-timeout`: time.Minute, `read-header-timeout`: time.Second * 50, `idle-timeout`: time.Minute * 3, `max-header-bytes`: 1024 * 1024 * 10, `cert-file`: ``, `key-file`: ``, `http2`: false, `http2-max-handlers`: 0, `http2-max-concurrent-streams`: 0, `http2-max-read-frame-size`: 0, `http2-permit-prohibited-cipher-suites`: false, `http2-idle-timeout`: time.Minute * 3, `http2-max-upload-buffer-per-connection`: 65535, `http2-max-upload-buffer-per-stream`: 0, }
Functions ¶
func New ¶
func New(app contract.Application) contract.HttpRouter
func NewHttp ¶
func NewHttp(application contract.Application, request *http.Request, responseWriter contract.HttpWrapResponseWriter) contract.HttpProtocol
func NewServer ¶
func NewServer(app contract.Application, srvConfig map[string]interface{}) contract.Server
func NewSession ¶
func NewWrapResponseWriter ¶
func NewWrapResponseWriter(responseWriter http.ResponseWriter) contract.HttpWrapResponseWriter
Types ¶
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
func (*Group) Use ¶
func (g *Group) Use(handlers ...contract.ContextHandler) contract.HttpRouteGroup
type Http ¶
type Http struct {
// contains filtered or unexported fields
}
func (*Http) Application ¶
func (h *Http) Application() contract.Application
func (*Http) ContentType ¶
func (*Http) IsContentType ¶
func (*Http) Params ¶
func (h *Http) Params() []httprouter.Param
func (*Http) ResponseWriter ¶
func (h *Http) ResponseWriter() contract.HttpWrapResponseWriter
func (*Http) SessionValue ¶
func (*Http) SetParams ¶
func (h *Http) SetParams(params []httprouter.Param)
func (*Http) SetSession ¶
type Provider ¶
type Provider struct {
kernel.BaseProvider
}
type Route ¶
type Route struct {
// contains filtered or unexported fields
}
func (*Route) Handlers ¶
func (r *Route) Handlers() []contract.ContextHandler
type Router ¶
type Router struct { Application contract.Application // contains filtered or unexported fields }
func (*Router) HttpRouter ¶
func (r *Router) HttpRouter() *httprouter.Router
func (*Router) NotFound ¶
func (r *Router) NotFound(handler contract.ContextHandler) contract.HttpRouter
Click to show internal directories.
Click to hide internal directories.