Documentation ¶
Index ¶
- func Access(ctx context.Context) map[string]string
- func Jaeger(cfg *config.Configuration) io.Closer
- func Param(ctx context.Context, key string) string
- func Params(ctx context.Context) httprouter.Params
- func Request(ctx context.Context) *http.Request
- func Response(ctx context.Context) http.ResponseWriter
- func Value(ctx context.Context, key string) interface{}
- func WithValue(ctx context.Context, key string, v interface{}) context.Context
- type Graphql
- type HTTP
- type Handle
- type Middleware
- type Router
- func (r *Router) CORS(c *cors.Cors) *Router
- func (r *Router) DELETE(path string, middlewaresAndHandle ...interface{}) *Router
- func (r *Router) GET(path string, middlewaresAndHandle ...interface{}) *Router
- func (r *Router) Graphql(path string, g *Graphql) *Router
- func (r *Router) HEAD(path string, middlewaresAndHandle ...interface{}) *Router
- func (r *Router) Handle(method, path string, middlewaresAndHandle ...interface{}) *Router
- func (r *Router) ListenAndServe()
- func (r *Router) Middlewares(layers ...Middleware) *Router
- func (r *Router) OPTIONS(path string, middlewaresAndHandle ...interface{}) *Router
- func (r *Router) PATCH(path string, middlewaresAndHandle ...interface{}) *Router
- func (r *Router) POST(path string, middlewaresAndHandle ...interface{}) *Router
- func (r *Router) PUT(path string, middlewaresAndHandle ...interface{}) *Router
- func (r *Router) Prefix(p string) *Router
- func (r *Router) Serve(l net.Listener)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Access ¶
Access context, everything added to this map will be logged as the field of access log
func Response ¶
func Response(ctx context.Context) http.ResponseWriter
Response get response from context
Types ¶
type HTTP ¶
type HTTP struct { Response http.ResponseWriter Request *http.Request Params httprouter.Params }
HTTP context
type Router ¶
type Router struct { *httprouter.Router // contains filtered or unexported fields }
Router thin wrapper for httprouter.Router
func (*Router) DELETE ¶
DELETE is a shortcut for router.Handle("DELETE", path, middlewaresAndHandle...)
func (*Router) ListenAndServe ¶
func (r *Router) ListenAndServe()
ListenAndServe is a shortcut for http.ListenAndServe
func (*Router) Middlewares ¶
func (r *Router) Middlewares(layers ...Middleware) *Router
Middlewares register middlewares
func (*Router) OPTIONS ¶
OPTIONS is a shortcut for router.Handle("OPTIONS", path, middlewaresAndHandle...)
func (*Router) PATCH ¶
PATCH is a shortcut for router.Handle("PATCH", path, middlewaresAndHandle...)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.