refactor(internal break) Enhance static file serving for modularity and performance

This commit is contained in:
wjqserver 2025-07-09 03:10:46 +08:00
parent 49508b49c1
commit 989eb34c4c
3 changed files with 429 additions and 464 deletions

View file

@ -42,3 +42,28 @@ type RouteInfo struct {
Handler string // 处理函数名称
Group string // 路由分组
}
// 维护一个Methods列表
var (
MethodGet = "GET"
MethodHead = "HEAD"
MethodPost = "POST"
MethodPut = "PUT"
MethodPatch = "PATCH"
MethodDelete = "DELETE"
MethodConnect = "CONNECT"
MethodOptions = "OPTIONS"
MethodTrace = "TRACE"
)
var MethodsSet = map[string]struct{}{
MethodGet: {},
MethodHead: {},
MethodPost: {},
MethodPut: {},
MethodPatch: {},
MethodDelete: {},
MethodConnect: {},
MethodOptions: {},
MethodTrace: {},
}