|
@@ -7,7 +7,6 @@ import (
|
|
|
|
|
|
"git.eugeniocarvalho.dev/eugeniucarvalho/apicodegen/api/errs"
|
|
|
"git.eugeniocarvalho.dev/eugeniucarvalho/apicodegen/api/sse"
|
|
|
- "github.com/kataras/iris"
|
|
|
context "github.com/kataras/iris/v12/context"
|
|
|
"go.mongodb.org/mongo-driver/bson/primitive"
|
|
|
)
|
|
@@ -110,18 +109,16 @@ func (debug *Debugger) CreateTask() *DebugTaks {
|
|
|
return task
|
|
|
}
|
|
|
|
|
|
-func (debug *Debugger) EventStream() func(context.Context) {
|
|
|
- return func(ctx context.Context) {
|
|
|
- if err := debug.Hub.UpgradeConnection(
|
|
|
+func (debug *Debugger) EventStream() func(context.Context) (interface{}, *errs.Error) {
|
|
|
+ return func(ctx context.Context) (resp interface{}, err *errs.Error) {
|
|
|
+ if err = debug.Hub.UpgradeConnection(
|
|
|
ctx,
|
|
|
debug.ChannelID,
|
|
|
); err != nil {
|
|
|
- ctx.JSON(iris.Map{
|
|
|
- "err": err,
|
|
|
- })
|
|
|
return
|
|
|
}
|
|
|
- ctx.JSON(iris.Map{})
|
|
|
+ resp = true
|
|
|
+ return
|
|
|
}
|
|
|
}
|
|
|
|