Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.11.0 #3

Merged
merged 23 commits into from Aug 2, 2019

Conversation

@toby1991
Copy link
Contributor

commented Aug 2, 2019

Websocket

  • Feat: Websocket support

  • Feat: Name route support

  • 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

Migration:

  1. func (d *Dashboard) Index(c *request.Context) { -> func (d *Dashboard) Index(c request.Context) {

  2. 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())
	}
}
  1. func(c request.Context) {:c.Request. -> c.Request().
  2. func(c request.Context) {:c.Params -> c.Params()
  3. set c.Writer, use c.SetWriter()
  4. set c.Request, use c.SetRequest()
  5. replace .Scan(c) in controller, user c.ScanUserWithJSON(), c is the Context
  6. replace .User().Value() in controller, use c.User().Value(), c is the Context

toby1991 added some commits Jul 29, 2019

change log first param to interface{}
Signed-off-by: Toby Yan <me@tobyan.com>
Make Totoval more compatible with multi port serve
Signed-off-by: Toby Yan <me@tobyan.com>
add basic_auth, basic_auth_for_realm middleware
Signed-off-by: Toby Yan <me@tobyan.com>
add monitor basic routes
Signed-off-by: Toby Yan <me@tobyan.com>
fix concurrent engineRouteMap conflict
Signed-off-by: Toby Yan <me@tobyan.com>
delete useless file
Signed-off-by: Toby Yan <me@tobyan.com>
change request.Context from struct to interface
Migration:
1. `func (d *Dashboard) Index(c *request.Context) {` -> `func (d *Dashboard) Index(c request.Context) {`

2. middleware
```go
func BasicAuth(accounts map[string]string) request.HandlerFunc {
	return func(c request.Context) {
		gin.BasicAuth(accounts)(c.Context)
	}
}
```
|
v
```go
func BasicAuth(accounts map[string]string) request.HandlerFunc {
	return func(c request.Context) {
		gin.BasicAuth(accounts)(c.GinContext())
	}
}
```

3. `func(c request.Context) {`:`c.Request.` -> `c.Request().`
4. `func(c request.Context) {`:`c.Params` -> `c.Params()`
5. set `c.Writer`, use `c.SetWriter()`
6. set `c.Request`, use `c.SetRequest()`

Signed-off-by: Toby Yan <me@tobyan.com>
fix a dashboard bug
Signed-off-by: Toby Yan <me@tobyan.com>
add websocket close
Signed-off-by: Toby Yan <me@tobyan.com>
Fix an User getter issue in controller
Fix an User getter issue in controller which my cause each request’s data cross using by different request.

Signed-off-by: Toby Yan <me@tobyan.com>
fix a RequestIUser problem
Signed-off-by: Toby Yan <me@tobyan.com>
move RequestUser from controller to Context
7. replace `.Scan(c)` in controller, user `c.ScanUserWithJSON()`, `c` is the `Context`
8. replace `.User().Value()` in controller, use `c.User().Value()`, `c` is the `Context`

Signed-off-by: Toby Yan <me@tobyan.com>
Add Totoval monitor
Signed-off-by: Toby Yan <me@tobyan.com>
Add Websocket Broadcase func
Signed-off-by: Toby Yan <me@tobyan.com>
Fix a bug of view binding
Signed-off-by: Toby Yan <me@tobyan.com>
Add authentication support for websocket hub
Signed-off-by: Toby Yan <me@tobyan.com>
update dashboard template
Signed-off-by: Toby Yan <me@tobyan.com>
update monitor handler with websocket hub example
Signed-off-by: Toby Yan <me@tobyan.com>
close msgChan after websocket closed
Signed-off-by: Toby Yan <me@tobyan.com>
Add monitor shutdown func
Signed-off-by: Toby Yan <me@tobyan.com>
Add routeName support
```go
route.Url("login")
```

Signed-off-by: Toby Yan <me@tobyan.com>
update readme
Signed-off-by: Toby Yan <me@tobyan.com>

@toby1991 toby1991 self-assigned this Aug 2, 2019

@toby1991 toby1991 merged commit ddd99fc into master Aug 2, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.