Documentation ¶
Index ¶
- Variables
- func AddController(c Controller)
- func AddControllers(cs ...Controller)
- func InitRouter(engine *gin.Engine)
- func SetGlobalContext() gin.HandlerFunc
- func Start()
- type Controller
- type Controllers
- type ResourceController
- func (c *ResourceController) InitRouter(r *gin.RouterGroup) *gin.RouterGroup
- func (c *ResourceController) RegisterResourceHandler(h ...ResourceHandler)
- func (c *ResourceController) RegisterRoute(httpMethod string, path string, handler gin.HandlerFunc)
- func (c *ResourceController) SetResourceHandlers(handlers []ResourceHandler)
- type ResourceHandler
Constants ¶
This section is empty.
Variables ¶
View Source
var Resources = &Controllers{ Controllers: []Controller{}, }
Functions ¶
func AddController ¶
func AddController(c Controller)
func AddControllers ¶
func AddControllers(cs ...Controller)
func InitRouter ¶
func SetGlobalContext ¶ added in v0.0.3
func SetGlobalContext() gin.HandlerFunc
Types ¶
type Controller ¶
type Controller interface {
InitRouter(*gin.RouterGroup) *gin.RouterGroup
}
type Controllers ¶
type Controllers struct { Base string Handlers []gin.HandlerFunc Controllers []Controller }
func (*Controllers) AddController ¶
func (s *Controllers) AddController(c ...Controller)
func (*Controllers) AddHandler ¶
func (s *Controllers) AddHandler(h ...gin.HandlerFunc)
func (*Controllers) InitRouter ¶
func (s *Controllers) InitRouter(r *gin.RouterGroup) *gin.RouterGroup
interface Controller
type ResourceController ¶
type ResourceController struct { Controllers ResourceHandlers []ResourceHandler }
func (*ResourceController) InitRouter ¶
func (c *ResourceController) InitRouter(r *gin.RouterGroup) *gin.RouterGroup
func (*ResourceController) RegisterResourceHandler ¶
func (c *ResourceController) RegisterResourceHandler(h ...ResourceHandler)
func (*ResourceController) RegisterRoute ¶
func (c *ResourceController) RegisterRoute(httpMethod string, path string, handler gin.HandlerFunc)
func (*ResourceController) SetResourceHandlers ¶
func (c *ResourceController) SetResourceHandlers(handlers []ResourceHandler)
type ResourceHandler ¶
type ResourceHandler struct { HttpMethod string ResourcePath string Handler gin.HandlerFunc }
Click to show internal directories.
Click to hide internal directories.