diff --git a/bindings/event.go b/bindings/event.go new file mode 100644 index 0000000000000000000000000000000000000000..21a076fa71b3ed921a558fb190679cdedcf1546b --- /dev/null +++ b/bindings/event.go @@ -0,0 +1,21 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright © 2020 xx network SEZC // +// // +// Use of this source code is governed by a license that can be found in the // +// LICENSE file // +/////////////////////////////////////////////////////////////////////////////// + +package bindings + +// RegisterEventCallback records the given function to receive +// ReportableEvent objects. It returns the internal index +// of the callback so that it can be deleted later. +func (c *Client) RegisterEventCallback(myFunc EventCallbackFunction) int { + return c.api.RegisterEventCallback(myFunc) +} + +// UnregisterEventCallback deletes the callback identified by the +// index. It returns an error if it fails. +func (c *Client) UnregisterEventCallback(index int) error { + return c.api.UnregisterEventCallback(index) +}