1 Star 1 Fork 0

fast_api/api

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
open_inf.go 680 Bytes
一键复制 编辑 原始数据 按行查看 历史
safe 提交于 2023-10-27 17:28 +08:00 . impl : websocket
package def
import (
"net/http"
"net/url"
)
type Request struct {
*http.Request
rw http.ResponseWriter
}
func (r *Request) ResponseWriter() http.ResponseWriter {
return r.rw
}
func WithRequest(rw http.ResponseWriter, req *http.Request) *Request {
return &Request{rw: rw, Request: req}
}
type Serialize interface {
Encode(interface{}) *Content
// Decode interface{} is out
Decode([]byte, interface{}) error
}
type Match interface {
Match(url *url.URL) *Entry
Add(key string, data interface{})
}
type Caller interface {
// CallerTrace
// Call request ==> object
Call(f *Entry, req *Request) interface{}
}
type CallerTrace interface {
Before() bool
After()
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/fast_api/api.git
git@gitee.com:fast_api/api.git
fast_api
api
api
v0.1.0

搜索帮助