45 lines
1.3 KiB
Go
45 lines
1.3 KiB
Go
package api
|
|
|
|
// ///////////////////////////////////////////////////////////////////
|
|
// IRouter & IRoutes in gin, we redefine it simple
|
|
// ///////////////////////////////////////////////////////////////////
|
|
//
|
|
// // IRouter defines all router handle interface
|
|
// // includes single and group router.
|
|
// type IRouter interface {
|
|
// IRoutes
|
|
// Group(string, ...HandlerFunc) *RouterGroup
|
|
// }
|
|
//
|
|
// // IRoutes defines all router handle interface.
|
|
// type IRoutes interface {
|
|
// Use(...HandlerFunc) IRoutes
|
|
//
|
|
// Handle(string, string, ...HandlerFunc) IRoutes
|
|
// Any(string, ...HandlerFunc) IRoutes
|
|
// GET(string, ...HandlerFunc) IRoutes
|
|
// POST(string, ...HandlerFunc) IRoutes
|
|
// DELETE(string, ...HandlerFunc) IRoutes
|
|
// PATCH(string, ...HandlerFunc) IRoutes
|
|
// PUT(string, ...HandlerFunc) IRoutes
|
|
// OPTIONS(string, ...HandlerFunc) IRoutes
|
|
// HEAD(string, ...HandlerFunc) IRoutes
|
|
//
|
|
// StaticFile(string, string) IRoutes
|
|
// StaticFileFS(string, string, http.FileSystem) IRoutes
|
|
// Static(string, string) IRoutes
|
|
// StaticFS(string, http.FileSystem) IRoutes
|
|
// }
|
|
//
|
|
// ///////////////////////////////////////////////////////////////////
|
|
|
|
type Handler interface {
|
|
ApiName() string
|
|
HandlerFunc() HandlerFunc
|
|
}
|
|
type HandlerFunc func(*Context) error
|
|
|
|
type IRoutes interface {
|
|
POST(uri string, handler Handler)
|
|
}
|