Documentation
¶
Index ¶
- func Translate(err error) []string
- type Action
- type App
- func (app *App) Bind(abstract string, closure contracts.ServiceFunc, share ...bool)
- func (app *App) GetEngine() *gin.Engine
- func (app *App) GetRoutesGroup() (result interface{})
- func (app *App) GetRoutesTree() interface{}
- func (app *App) InjectApp(providers interface{}) interface{}
- func (app *App) Make(abstract string) interface{}
- func (app *App) Middlewares(middlewares interface{})
- func (app *App) Name() string
- func (app *App) NoRoute(handlers ...interface{})
- func (app *App) RegistEvent(listens interface{})
- func (app *App) Register(providers interface{})
- func (app *App) Run(addr ...string)
- func (app *App) SetFuncMap(funcMap template.FuncMap)
- func (app *App) SetHTMLTemplate(views fs.FS)
- func (app *App) Singleton(abstract string, closure contracts.ServiceFunc)
- func (app *App) Use(middlewares ...interface{})
- type Context
- func (c *Context) Auth(guard ...string) contracts.IAuth
- func (c *Context) HTML(code int, name string, obj interface{})
- func (c *Context) NewPagination(total int64) *pagination
- func (c *Context) ParseParams(key string) map[string]string
- func (c *Context) Share(key string, data interface{})
- func (c *Context) Shared(key string) interface{}
- type Controller
- func (ctrl *Controller) Create(c *Context)
- func (ctrl *Controller) Destroy(c *Context)
- func (ctrl *Controller) Edit(c *Context)
- func (ctrl *Controller) Index(c *Context)
- func (ctrl *Controller) Init(c *Context)
- func (ctrl *Controller) NotFound(c *Context)
- func (ctrl *Controller) Show(c *Context)
- func (ctrl *Controller) Store(c *Context)
- func (ctrl *Controller) Update(c *Context)
- type H
- type HandlerFunc
- type IController
- type IRouter
- type IRoutes
- type RouterGroup
- func (r *RouterGroup) Any(relativePath string, args ...interface{}) IRoutes
- func (r *RouterGroup) Delete(relativePath string, args ...interface{}) IRoutes
- func (r *RouterGroup) Get(relativePath string, args ...interface{}) IRoutes
- func (r *RouterGroup) Group(relativePath string, args ...interface{}) *RouterGroup
- func (r *RouterGroup) Handle(httpMethod, relativePath string, args ...interface{}) IRoutes
- func (r *RouterGroup) Head(relativePath string, args ...interface{}) IRoutes
- func (r *RouterGroup) Options(relativePath string, args ...interface{}) IRoutes
- func (r *RouterGroup) Patch(relativePath string, args ...interface{}) IRoutes
- func (r *RouterGroup) Post(relativePath string, args ...interface{}) IRoutes
- func (r *RouterGroup) Put(relativePath string, args ...interface{}) IRoutes
- func (r *RouterGroup) Resource(relativePath string, ctrl IController, comment string)
- func (r *RouterGroup) Use(args ...interface{}) IRoutes
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Action ¶
type Action map[IController]string
type App ¶
type App struct { Engine *gin.Engine Router RouterGroup FuncMap template.FuncMap // contains filtered or unexported fields }
func (*App) Bind ¶
func (app *App) Bind(abstract string, closure contracts.ServiceFunc, share ...bool)
每次实例化
func (*App) GetRoutesGroup ¶ added in v0.0.6
func (app *App) GetRoutesGroup() (result interface{})
获取路由数组,数组每个元素都是一个路由组
type Context ¶
func (*Context) ParseParams ¶
对含有*号的路由转为参数 如 /user/*action ( /user/region/china/page/3 map[string]string{"region":"china", "page":"3"})
type Controller ¶
type Controller struct {
App contracts.IApplication
}
func (*Controller) NotFound ¶
func (ctrl *Controller) NotFound(c *Context)
type HandlerFunc ¶
type HandlerFunc func(*Context)
type IController ¶
type IController interface { Init(*Context) Index(*Context) Show(*Context) Create(*Context) Store(*Context) Edit(*Context) Update(*Context) Destroy(*Context) }
restful api 控制器接口
type IRouter ¶
type IRouter interface { IRoutes Group(string, ...interface{}) *RouterGroup }
type IRoutes ¶
type IRoutes interface { Use(...interface{}) IRoutes Handle(string, string, ...interface{}) IRoutes Any(string, ...interface{}) IRoutes Get(string, ...interface{}) IRoutes Post(string, ...interface{}) IRoutes Delete(string, ...interface{}) IRoutes Patch(string, ...interface{}) IRoutes Put(string, ...interface{}) IRoutes Options(string, ...interface{}) IRoutes Head(string, ...interface{}) IRoutes }
type RouterGroup ¶
type RouterGroup struct { App *App GRouter *gin.RouterGroup Comment string // contains filtered or unexported fields }
func (*RouterGroup) Any ¶
func (r *RouterGroup) Any(relativePath string, args ...interface{}) IRoutes
func (*RouterGroup) Delete ¶
func (r *RouterGroup) Delete(relativePath string, args ...interface{}) IRoutes
func (*RouterGroup) Get ¶
func (r *RouterGroup) Get(relativePath string, args ...interface{}) IRoutes
func (*RouterGroup) Group ¶
func (r *RouterGroup) Group(relativePath string, args ...interface{}) *RouterGroup
func (*RouterGroup) Handle ¶
func (r *RouterGroup) Handle(httpMethod, relativePath string, args ...interface{}) IRoutes
func (*RouterGroup) Head ¶
func (r *RouterGroup) Head(relativePath string, args ...interface{}) IRoutes
func (*RouterGroup) Options ¶
func (r *RouterGroup) Options(relativePath string, args ...interface{}) IRoutes
func (*RouterGroup) Patch ¶
func (r *RouterGroup) Patch(relativePath string, args ...interface{}) IRoutes
func (*RouterGroup) Post ¶
func (r *RouterGroup) Post(relativePath string, args ...interface{}) IRoutes
func (*RouterGroup) Put ¶
func (r *RouterGroup) Put(relativePath string, args ...interface{}) IRoutes
func (*RouterGroup) Resource ¶
func (r *RouterGroup) Resource(relativePath string, ctrl IController, comment string)
func (*RouterGroup) Use ¶
func (r *RouterGroup) Use(args ...interface{}) IRoutes
Click to show internal directories.
Click to hide internal directories.