router

package
v1.13.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 14, 2023 License: Apache-2.0 Imports: 10 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func E added in v1.9.0

func E() *gin.Engine

func Handle

func Handle(httpMethod, relativePath string, handlers ...HandlerFunc)

func Handler

func Handler() http.Handler

func TE added in v1.8.0

func TE(t *testing.T, cases ...TC)

Types

type Context

type Context = gin.Context

type HandlerFunc added in v1.9.0

type HandlerFunc func(c *Context)

type IRouter added in v1.9.0

type IRouter interface {
	IRoutes
	Group(string, ...HandlerFunc) IRouter
}

func Group

func Group(relativePath string, handlers ...HandlerFunc) IRouter

type IRoutes added in v1.9.0

type IRoutes interface {
	Use(...HandlerFunc) IRoutes

	Handle(string, string, ...HandlerFunc)
}

func Use added in v1.9.0

func Use(middlewares ...HandlerFunc) IRoutes

type Router added in v1.9.0

type Router struct {
	// contains filtered or unexported fields
}

func (*Router) Group added in v1.9.0

func (r *Router) Group(relativePath string, handlers ...HandlerFunc) IRouter

func (*Router) Handle added in v1.9.0

func (r *Router) Handle(httpMethod, relativePath string, handlers ...HandlerFunc)

func (*Router) Use added in v1.9.0

func (r *Router) Use(middlewares ...HandlerFunc) IRoutes

type Routes added in v1.9.0

type Routes struct {
	// contains filtered or unexported fields
}

func (*Routes) Handle added in v1.9.0

func (r *Routes) Handle(httpMethod, relativePath string, handlers ...HandlerFunc)

func (*Routes) Use added in v1.9.0

func (r *Routes) Use(middlewares ...HandlerFunc) IRoutes

type TC added in v1.8.0

type TC struct {
	Method  string
	Pattern string
	Body    string

	Dump bool

	WarpReq func(t *testing.T, req *http.Request)
	Verify  func(t *testing.T, resp *http.Response, code int, body string)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL