
本文共 2415 字,大约阅读时间需要 8 分钟。
go-zero ���������������������������������������
������������������������������������
��� go-zero ���������������������������������������������������������������������������
���������������������
- ���������������������
Route
���������������������������������������type Route struct { Method string Path string Hander http.HandlerFunc}
Method
��������������������������� GET���POST������Path
���������������������������Hander
���������http.HandlerFunc
������������������������������������������������
������������������������
- ���������������������������
featuredRoutes
������������routes
���������������������������������������������������������������������������������������������������������type featuredRoutes struct { routes []Route // ������������������������ // ������������������������jwt������������}
���������������������������
- ���������������������������������������
Server
���������nginx.routes
������������������������������������������
������������������
��� go-zero
���������������������������������������������������������������������������
���������������
- ������
handler.RegisterHandlers(server, ctx)
��������������������� - ���������������������������������������������������������������������������������������������������
���������������������
- ������������������������������������������������������������������������������������
- ���������������������������������������������������
Handler
���������
handler ������������
���������������������������������Handler
������������������������������������������
������ ServeHTTP
��������������������� http ���������
������������������������������������������������������������������������
type Handler interface { ServeHTTP(http.ResponseWriter, *http.Request)}
���������������������������
���������������������������
type EngineWithMiddlewares struct { handler Handler middlewares []Middleware}
������������������������
- ���������������������������������������
- ���������������������������������������������������������������
- ���������������������������������������������������������������
���������������������������������
���������������������������������go-zero
��������������������������������������������������������������������������������������� High Stockholm ������������������������������������������������������������������������������������������������������������������������������������
发表评论
最新留言
关于作者
