kataras on master
minor (see previous commit) (compare)
kataras on master
minor (see previous commit) (compare)
kataras on master
minor (see previous commit) (compare)
kataras on master
New feature: Context.ReadJSONSt… (compare)
kataras on master
New feature: Fallback views. Re… (compare)
kataras on master
thank you @mattbowen for your k… (compare)
kataras on master
thank you @always-waiting for y… (compare)
kataras on master
README: minor (compare)
kataras on master
Update README_ZH.md Merge pull request #1707 from w… (compare)
kataras on master
udpate modifyProxiedRequest Merge pull request #1710 from t… (compare)
kataras on master
Add example for #1706 (we alrea… (compare)
kataras on master
update host.ProxyHandler to com… update TestProxy add ProxyHandlerRemote and NewP… and 1 more (compare)
kataras on master
README: minor (compare)
kataras on master
Expose the ConfigureContainer()… (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: