An out-of-the-box artisan API web-framework written in go.
Feat: Websocket support
Feat: Name route support
Feat: Log now support interface{}
for the first param
Feat: Make Totoval more compatible with multi port serve
Feat: Add Totoval monitor
Feat: Change request.Context from struct to interface
Fix: move RequestUser from controller to Context
Fix: An User getter issue in controller which may cause each request's data cross using by different request.
Fix: A bug of view binding
func (d *Dashboard) Index(c *request.Context) {
-> func (d *Dashboard) Index(c request.Context) {
middleware
func BasicAuth(accounts map[string]string) request.HandlerFunc {
return func(c request.Context) {
gin.BasicAuth(accounts)(c.Context)
}
}
| v
func BasicAuth(accounts map[string]string) request.HandlerFunc {
return func(c request.Context) {
gin.BasicAuth(accounts)(c.GinContext())
}
}
func(c request.Context) {
:c.Request.
-> c.Request().
func(c request.Context) {
:c.Params
-> c.Params()
c.Writer
, use c.SetWriter()
c.Request
, use c.SetRequest()
.Scan(c)
in controller, user c.ScanUserWithJSON()
, c
is the Context
.User().Value()
in controller, use c.User().Value()
, c
is the Context
Totoval v0.10.3
is the first production use major release.
Here comes the features:
Pagination
nsq
biu
sentry
For more docs about the features above, please see Totoval Docs.