diff --git a/bindings/connect.go b/bindings/connect.go index 3c414bd8bfa376434e62a5d4db7cb02e7824601c..d8e6db0acf984caa4b320f978e8e0b5059592dd5 100644 --- a/bindings/connect.go +++ b/bindings/connect.go @@ -15,12 +15,17 @@ var connectionTrackerSingleton = &connectionTracker{ count: 0, } -// Connection is the bindings representation of a connect.Connection object that can be tracked +// Connection is the bindings representation of a connect.Connection object that can be tracked by id type Connection struct { connection connect.Connection id int } +// GetId returns the Connection.id +func (c *Connection) GetId() int { + return c.id +} + // Connect performs auth key negotiation with the given recipient, // and returns a Connection object for the newly-created partner.Manager // This function is to be used sender-side and will block until the diff --git a/bindings/delivery.go b/bindings/delivery.go index 3066880c4ed27a9474b9cc8bcd4aedcb2ff5c194..57fcbfa4d34ede1307cb628691ca5fde4210bd47 100644 --- a/bindings/delivery.go +++ b/bindings/delivery.go @@ -48,6 +48,9 @@ func makeRoundsList(rounds []id.Round) RoundsList { // MessageDeliveryCallback gets called on the determination if all events // related to a message send were successful. +// If delivered == true, timedOut == false && roundResults != nil +// If delivered == false, roundResults == nil +// If timedOut == true, delivered == false && roundResults == nil type MessageDeliveryCallback interface { EventCallback(delivered, timedOut bool, roundResults []byte) } diff --git a/bindings/follow.go b/bindings/follow.go index 4ad4620d19d5a385ac9d6b7fbad3efa00716bf5e..ae81595b23ed0bbb627f6e112b86c5af47903919 100644 --- a/bindings/follow.go +++ b/bindings/follow.go @@ -1,6 +1,8 @@ package bindings import ( + "fmt" + "github.com/pkg/errors" "gitlab.com/xx_network/primitives/netTime" "time" ) @@ -38,6 +40,19 @@ func (c *Client) StartNetworkFollower(timeoutMS int) error { return c.api.StartNetworkFollower(timeout) } +// StopNetworkFollower stops the network follower if it is running. +// It returns errors if the Follower is in the wrong status to stop or if it +// fails to stop it. +// if the network follower is running and this fails, the client object will +// most likely be in an unrecoverable state and need to be trashed. +func (c *Client) StopNetworkFollower() error { + if err := c.api.StopNetworkFollower(); err != nil { + return errors.New(fmt.Sprintf("Failed to stop the "+ + "network follower: %+v", err)) + } + return nil +} + // WaitForNewtwork will block until either the network is healthy or the // passed timeout. It will return true if the network is healthy func (c *Client) WaitForNetwork(timeoutMS int) bool { diff --git a/bindings/version.go b/bindings/version.go new file mode 100644 index 0000000000000000000000000000000000000000..7e84bbd2ed1a0de0825e47a24e5e62ffa2f9f78a --- /dev/null +++ b/bindings/version.go @@ -0,0 +1,24 @@ +//////////////////////////////////////////////////////////////////////////////// +// Copyright © 2022 Privategrity Corporation / +// / +// All rights reserved. / +//////////////////////////////////////////////////////////////////////////////// + +package bindings + +import "gitlab.com/elixxir/client/api" + +// GetVersion returns the api SEMVER +func GetVersion() string { + return api.SEMVER +} + +// GetGitVersion rturns the api GITVERSION +func GetGitVersion() string { + return api.GITVERSION +} + +// GetDependencies returns the api DEPENDENCIES +func GetDependencies() string { + return api.DEPENDENCIES +}