Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type App ¶
type App struct {
boot.BaseInstance
// contains filtered or unexported fields
}
App is the application entrypoint.
func (*App) AddValidator ¶
AddValidator 增加自定义验证器
type Group ¶
type Group struct {
Path string // 路径
Middlewares []Middleware // 中间件函数
Routers []Router // 路由
}
Group 路由的分组
func (*Group) GetMiddlewares ¶
func (g *Group) GetMiddlewares() []echo.MiddlewareFunc
GetMiddlewares 获取所有注册中间件
type Http2App ¶
type Http2App struct {
App
CertPemPath string // cert.pem所在文件的路径
KeyPemPath string // key.pem所在文件的路径
}
Hhttp2App http2协议的实现
func NewHttp2App ¶
NewHttp2App 创建一个http2协议的实现
type Middleware ¶
type Middleware interface {
MiddlewareFunc() echo.MiddlewareFunc
}
Middleware 中间件抽象
func NewMiddlewareBearerJwt ¶
func NewMiddlewareBearerJwt(jwtSecert string) Middleware
NewMiddlewareBearerJwt 使用Bearer Token的中间件生成器
type MiddlewareBearerJwt ¶
MiddlewareBearerJwt 使用Bearer Token的一个中间件
func (*MiddlewareBearerJwt) GetHeaderToken ¶
func (m *MiddlewareBearerJwt) GetHeaderToken(c echo.Context) (string, error)
GetHeaderToken 从请求头获取Token
func (*MiddlewareBearerJwt) MiddlewareFunc ¶
func (m *MiddlewareBearerJwt) MiddlewareFunc() echo.MiddlewareFunc
MiddlewareFunc 对Middleware的实现
type Router ¶
type Router struct {
Method string // 方法
Path string // 路径
Name string // 名称
Handle echo.HandlerFunc // 处理函数
Middlewares []Middleware // 中间件函数
}
Router 路由
func (*Router) GetMiddlewares ¶
func (r *Router) GetMiddlewares() []echo.MiddlewareFunc
GetMiddlewares 获取所有注册中间件
type StructValidator ¶
type StructValidator struct {
// contains filtered or unexported fields
}
StructValidator 结构体验证器
func (*StructValidator) AddValidator ¶
func (s *StructValidator) AddValidator(tag string, v validator.Func) error
AddValidator 增加自定义验证器
func (*StructValidator) Validate ¶
func (s *StructValidator) Validate(i interface{}) error
Validate 实现echo.Validator
Click to show internal directories.
Click to hide internal directories.