From 5b944107b046662b2729efec7188da8061ad850a Mon Sep 17 00:00:00 2001 From: "Richard T. Carback III" <rick.carback@gmail.com> Date: Mon, 23 Aug 2021 19:22:05 +0000 Subject: [PATCH] Add event callback registration to the bindings --- bindings/event.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 bindings/event.go diff --git a/bindings/event.go b/bindings/event.go new file mode 100644 index 000000000..21a076fa7 --- /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) +} -- GitLab