Skip to content

v0.0.4

Pre-release
Pre-release
Compare
Choose a tag to compare
@kataras kataras released this 07 Jul 05:27
· 41 commits to v0 since this release

Improvements of the neffos.NewStruct connection handler.

  • With the new EnableDebug(nil_or_custom_printer) the neffos.NewStruct will log which field is marked as static, which method is handling a specific event and etc.
  • A new method Events() neffos.Events is added to the return value of the neffos.NewStruct in order to handle that struct as raw neffos.Events - this adds support to wrap one or more "controllers" on a neffos.Namespaces or neffos.WithTimeout connection handler. Note that when Events() is used then its SetNamespace and SetTimeouts have no effect because they should be handled by the parent level instead.

Example Code:

var events = neffos.Namespaces{
    "ns1": neffos.NewStruct(new(myWebsocketController)).Events(),
    "ns2": neffos.Events{...},
}

Have fun!