Ai
1 Star 0 Fork 0

csingo/cServer

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
RouteConf.go 1.21 KB
一键复制 编辑 原始数据 按行查看 历史
cxy1620541673 提交于 2025-04-07 17:58 +08:00 . update
package cServer
import (
"gitee.com/csingo/cController"
)
const RouteConfigName = "RouteConf"
type RouteType int
const (
RouteTypeNil RouteType = iota
RouteTypeApi
RouteTypeFile
RouteTypeDir
RouteTypeView
RouteTypeGrpc
RouteTypeGroup
)
type RouteConf struct {
Type RouteType `json:"type"`
Path string `json:"path"`
Method []string `json:"method"`
Target string `json:"target"`
App string `json:"app"`
Controller string `json:"controller"`
Function string `json:"function"`
Middlewares []RouteConf_Middleware `json:"middlewares"`
Routes []RouteConf `json:"routes"`
Handler cController.RouteHandlerFunc `json:"-"`
}
type RouteConf_Middlewares struct {
Prefix []RouteConf_Middleware `json:"prefix"`
Suffix []RouteConf_Middleware `json:"suffix"`
}
type RouteConf_Middleware struct {
App string `json:"app"`
Name string `json:"name"`
Params map[string]any `json:"params"`
}
func (i *RouteConf) ConfigName() string {
return RouteConfigName
}
var route_config *RouteConf
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/csingo/cServer.git
git@gitee.com:csingo/cServer.git
csingo
cServer
cServer
v0.4.27

搜索帮助