1 Star 2 Fork 0

falling-ts/gower

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
route.go 2.87 KB
一键复制 编辑 原始数据 按行查看 历史
falling-ts 提交于 2024-12-08 00:45 . feat 完善高级数据处理
package services
import (
"github.com/gin-gonic/gin"
"html/template"
"io/fs"
"net"
"net/http"
)
// Handler 将 gin 中间件使用的处理程序定义为返回值.
type Handler any
// Handlers HandlersChain 定义 HandlerFunc 的切片.
type Handlers []Handler
// IRouter 定义所有路由器句柄接口, 包括单路由器和组路由器.
type IRouter interface {
IRoutes
Group(string, ...Handler) IRouter
}
// IRoutes 定义所有路由器句柄接口.
type IRoutes interface {
Use(...Handler) RouteService
Handle(string, string, ...Handler) IRoutes
Any(string, ...Handler) IRoutes
GET(string, ...Handler) IRoutes
POST(string, ...Handler) IRoutes
DELETE(string, ...Handler) IRoutes
PATCH(string, ...Handler) IRoutes
PUT(string, ...Handler) IRoutes
OPTIONS(string, ...Handler) IRoutes
HEAD(string, ...Handler) IRoutes
Match([]string, string, ...Handler) IRoutes
Resource(string, any, ...Handler) IRoutes
StaticFile(string, string) IRoutes
StaticFileFS(string, string, http.FileSystem) IRoutes
Static(string, string) IRoutes
StaticFS(string, http.FileSystem) IRoutes
}
// RouteService 路由服务接口
type RouteService interface {
Service
Handler() http.Handler
SecureJsonPrefix(prefix string) RouteService
Delims(left, right string) RouteService
LoadHTMLGlob(pattern string)
LoadHTMLGlobs(patterns ...string) error
LoadHTMLFS(embed fs.FS, patterns ...string)
LoadHTMLFiles(files ...string)
SetHTMLTemplate(tmpl *template.Template)
SetFuncMap(funcMap template.FuncMap)
NoRoute(handlers ...Handler)
NoMethod(handlers ...Handler)
Routes() (routes gin.RoutesInfo)
Run(addr ...string) (err error)
RunTLS(addr, certFile, keyFile string) (err error)
RunUnix(file string) (err error)
RunFd(fd int) (err error)
RunListener(listener net.Listener) (err error)
HandleContext(c *gin.Context)
Group(relativePath string, handlers ...Handler) IRouter
UseBefore(middleware ...Handler) RouteService
Use(middleware ...Handler) RouteService
Handle(httpMethod, relativePath string, handlers ...Handler) IRoutes
Any(relativePath string, handlers ...Handler) IRoutes
GET(relativePath string, handlers ...Handler) IRoutes
POST(relativePath string, handlers ...Handler) IRoutes
DELETE(relativePath string, handlers ...Handler) IRoutes
PATCH(relativePath string, handlers ...Handler) IRoutes
PUT(relativePath string, handlers ...Handler) IRoutes
OPTIONS(relativePath string, handlers ...Handler) IRoutes
HEAD(relativePath string, handlers ...Handler) IRoutes
Match(methods []string, relativePath string, handlers ...Handler) IRoutes
Resource(resource string, controller any, handlers ...Handler) IRoutes
StaticFile(relativePath, filepath string) IRoutes
StaticFileFS(relativePath, filepath string, fs http.FileSystem) IRoutes
Static(relativePath, root string) IRoutes
StaticFS(relativePath string, fs http.FileSystem) IRoutes
ServeHTTP(w http.ResponseWriter, req *http.Request)
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/falling-ts/gower.git
git@gitee.com:falling-ts/gower.git
falling-ts
gower
gower
v0.9.2

搜索帮助

0d507c66 1850385 C8b1a773 1850385