Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
client
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elixxir
client
Commits
30f6bb4b
Commit
30f6bb4b
authored
Jun 2, 2022
by
Jake Taylor
Browse files
Options
Downloads
Patches
Plain Diff
added some bindings
parent
9670bcd9
Branches
Branches containing commit
Tags
Tags containing commit
3 merge requests
!510
Release
,
!226
WIP: Api2.0
,
!207
WIP: Client Restructure
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
bindings/connect.go
+6
-1
6 additions, 1 deletion
bindings/connect.go
bindings/delivery.go
+3
-0
3 additions, 0 deletions
bindings/delivery.go
bindings/follow.go
+15
-0
15 additions, 0 deletions
bindings/follow.go
bindings/version.go
+24
-0
24 additions, 0 deletions
bindings/version.go
with
48 additions
and
1 deletion
bindings/connect.go
+
6
−
1
View file @
30f6bb4b
...
@@ -15,12 +15,17 @@ var connectionTrackerSingleton = &connectionTracker{
...
@@ -15,12 +15,17 @@ var connectionTrackerSingleton = &connectionTracker{
count
:
0
,
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
{
type
Connection
struct
{
connection
connect
.
Connection
connection
connect
.
Connection
id
int
id
int
}
}
// GetId returns the Connection.id
func
(
c
*
Connection
)
GetId
()
int
{
return
c
.
id
}
// Connect performs auth key negotiation with the given recipient,
// Connect performs auth key negotiation with the given recipient,
// and returns a Connection object for the newly-created partner.Manager
// and returns a Connection object for the newly-created partner.Manager
// This function is to be used sender-side and will block until the
// This function is to be used sender-side and will block until the
...
...
This diff is collapsed.
Click to expand it.
bindings/delivery.go
+
3
−
0
View file @
30f6bb4b
...
@@ -48,6 +48,9 @@ func makeRoundsList(rounds []id.Round) RoundsList {
...
@@ -48,6 +48,9 @@ func makeRoundsList(rounds []id.Round) RoundsList {
// MessageDeliveryCallback gets called on the determination if all events
// MessageDeliveryCallback gets called on the determination if all events
// related to a message send were successful.
// 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
{
type
MessageDeliveryCallback
interface
{
EventCallback
(
delivered
,
timedOut
bool
,
roundResults
[]
byte
)
EventCallback
(
delivered
,
timedOut
bool
,
roundResults
[]
byte
)
}
}
...
...
This diff is collapsed.
Click to expand it.
bindings/follow.go
+
15
−
0
View file @
30f6bb4b
package
bindings
package
bindings
import
(
import
(
"fmt"
"github.com/pkg/errors"
"gitlab.com/xx_network/primitives/netTime"
"gitlab.com/xx_network/primitives/netTime"
"time"
"time"
)
)
...
@@ -38,6 +40,19 @@ func (c *Client) StartNetworkFollower(timeoutMS int) error {
...
@@ -38,6 +40,19 @@ func (c *Client) StartNetworkFollower(timeoutMS int) error {
return
c
.
api
.
StartNetworkFollower
(
timeout
)
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
// WaitForNewtwork will block until either the network is healthy or the
// passed timeout. It will return true if the network is healthy
// passed timeout. It will return true if the network is healthy
func
(
c
*
Client
)
WaitForNetwork
(
timeoutMS
int
)
bool
{
func
(
c
*
Client
)
WaitForNetwork
(
timeoutMS
int
)
bool
{
...
...
This diff is collapsed.
Click to expand it.
bindings/version.go
0 → 100644
+
24
−
0
View file @
30f6bb4b
////////////////////////////////////////////////////////////////////////////////
// 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
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment