kataras on master
Thanks @gnosthi and @ndimorle f… (compare)
kataras on master
Thanks @mmckeen75 and @lauwelia… (compare)
kataras on master
minor: typo (compare)
kataras on v12.2.0-alpha2
kataras on master
thanks @rsousacode and @carlos-… (compare)
kataras on minor-improvements-and-fixes
kataras on master
:) Merge pull request #1701 from k… (compare)
kataras on minor-improvements-and-fixes
:) (compare)
kataras on master
minor (compare)
kataras on master
fixed code quality issues using… Merge branch 'master' into mast… Merge pull request #1694 from w… (compare)
kataras on master
fix response.timestamp not appe… remove unnecessary code minor: fix: examples/mvc/error-… (compare)
@shanyujie I've just tried to install iris v11.2.2 on a clean machine and it worked perfectly. So I assume it has to do with your local go cache, please try to clear your go cache: $GOPATH/src/pkg/mod
.
About your second question, I don't use that plugin, I use the vscode-go
plugin and it works perffectly, just import "github.com/kataras/iris"
and type iris.
and you will see the autocomplete definitions. You may want to post this issue on the vscode plugin you're using.
github.com/kataras/iris v11.2.2
in your go.mod
file and then go build
.
@kastmgnru we have ton of examples at: https://github.com/kataras/iris/tree/master/_examples/websocket , https://github.com/kataras/neffos/tree/master/_examples and https://github.com/kataras/neffos.js/tree/master/_examples. And also the wiki page of Broadcast
: https://github.com/kataras/neffos/wiki/Broadcast.
To send to all clients:
server.Broadcast(nil, neffos.Message{Namespace: "...", Event: "...", Body: yourMessage})
To send to all clients except one ID:
server.Broadcast(conn, neffos.Message{Namespace: "...", Event: "...", Body: yourMessage})
OR
server.Broadcast(neffos.Except("connID"), neffos.Message{Namespace: "...", Event: "...", Body: yourMessage})
To send to a specific one, set the To
field of the Message
:
server.Broadcast(conn, neffos.Message{To: "connectionID", Namespace: "...", Event: "...", Body: yourMessage})
OR, if you have access to the connection value:
conn.Emit("event", yourMessage)
app := iris.New()
r, close := newRequestLogger()
defer close()
app.Use(r)
app.OnAnyErrorCode(r, func(ctx iris.Context) {
ctx.Values().Set("error_log", "error")
ctx.JSON(http.ApiFailedResponse(ctx.GetStatusCode(), "error", nil))
})
ctx.GetBody()
and run with iris.Run(..., iris.WithoutBodyConsumptionOnUnmarshal)
if you want to re-use the response body later on in the same request-response lifecycle (handler chain). GetBody: doc and GetBody: example.
Hello @giladsh1,
This is happening because you initialized the Iris application with app := iris.Default()
, which registers the request logger middleware and recover, use app := iris.New()
instead and customize the request logger (if you need to log the requests) as you want. You can change the log output and customize each log message through logger's Handle
method.
Resources: