SDK Golang v1.x

You are currently looking at the documentation of a previous version of Kuzzle. We strongly recommend that you use the latest version. You can also use the version selector in the top menu.

Once #

Adds a one-time channel to an event.

The next time the event is triggered, this channel is removed and then fed.

Whenever an event is triggered, channels are fed in the order they were registered.

Channels removed this way are not closed.

Arguments #

Copied to clipboard!
Once(event int, channel chan<- interface{})

Argument Type Description
Event constant from the event package
Event payload channel

Usage #

Copied to clipboard!
ch := make(chan json.RawMessage)
kuzzle.Once(event.Connected, ch)
go func() {
  for range ch {
    fmt.Println("Connected to Kuzzle")