From e4951b5d31a9c49961917d00b0cd54bfd180ba81 Mon Sep 17 00:00:00 2001 From: josh <josh@elixxir.io> Date: Wed, 15 Dec 2021 16:14:25 -0800 Subject: [PATCH] Add GetRateLimitParams to bindings --- api/client.go | 7 +++++++ bindings/client.go | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/api/client.go b/api/client.go index 62cdb4ed8..45528fec7 100644 --- a/api/client.go +++ b/api/client.go @@ -579,6 +579,13 @@ func (c *Client) GetNetworkInterface() interfaces.NetworkManager { return c.network } +// GetRateLimitParams retrieves the rate limiting parameters. +func (c *Client) GetRateLimitParams() (uint32, uint32, int64) { + rateLimitParams := c.storage.GetBucketParams().Get() + return rateLimitParams.Capacity, rateLimitParams.LeakedTokens, + rateLimitParams.LeakDuration.Nanoseconds() +} + // GetNodeRegistrationStatus gets the current state of node registration. It // returns the total number of nodes in the NDF and the number of those which // are currently registers with. An error is returned if the network is not diff --git a/bindings/client.go b/bindings/client.go index 91293ba3d..7f5dfaeb4 100644 --- a/bindings/client.go +++ b/bindings/client.go @@ -485,6 +485,11 @@ func (c *Client) GetPreferredBins(countryCode string) (string, error) { return buff.String(), nil } +// GetRateLimitParams retrieves the rate limiting parameters. +func (c *Client) GetRateLimitParams() (uint32, uint32, int64) { + return c.api.GetRateLimitParams() +} + /* // SearchWithHandler is a non-blocking search that also registers // a callback interface for user disovery events. -- GitLab