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
ca1555bd
Commit
ca1555bd
authored
Oct 20, 2020
by
Richard T. Carback III
Browse files
Options
Downloads
Patches
Plain Diff
Use Trace logging
parent
c4799479
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
bindings/client.go
+4
-4
4 additions, 4 deletions
bindings/client.go
with
4 additions
and
4 deletions
bindings/client.go
+
4
−
4
View file @
ca1555bd
...
@@ -9,6 +9,7 @@ package bindings
...
@@ -9,6 +9,7 @@ package bindings
import
(
import
(
"errors"
"errors"
"github.com/spf13/jwalterweatherman"
"github.com/spf13/jwalterweatherman"
jww
"github.com/spf13/jwalterweatherman"
"gitlab.com/elixxir/client/api"
"gitlab.com/elixxir/client/api"
"gitlab.com/elixxir/client/interfaces/bind"
"gitlab.com/elixxir/client/interfaces/bind"
"gitlab.com/elixxir/client/interfaces/contact"
"gitlab.com/elixxir/client/interfaces/contact"
...
@@ -61,6 +62,9 @@ func NewPrecannedClient(precannedID int, network, storageDir string, password []
...
@@ -61,6 +62,9 @@ func NewPrecannedClient(precannedID int, network, storageDir string, password []
// starts subprocesses to perform network operations.
// starts subprocesses to perform network operations.
func
Login
(
storageDir
string
,
password
[]
byte
)
(
*
Client
,
error
)
{
func
Login
(
storageDir
string
,
password
[]
byte
)
(
*
Client
,
error
)
{
// TODO: This should wrap the bindings ClientImpl, when available.
// TODO: This should wrap the bindings ClientImpl, when available.
jww
.
SetStdoutThreshold
(
jww
.
LevelTrace
)
jww
.
SetLogThreshold
(
jww
.
LevelTrace
)
client
,
err
:=
api
.
Login
(
storageDir
,
password
)
client
,
err
:=
api
.
Login
(
storageDir
,
password
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
...
@@ -68,13 +72,11 @@ func Login(storageDir string, password []byte) (*Client, error) {
...
@@ -68,13 +72,11 @@ func Login(storageDir string, password []byte) (*Client, error) {
return
&
Client
{
*
client
},
nil
return
&
Client
{
*
client
},
nil
}
}
//Unmarshals a marshaled contact object
//Unmarshals a marshaled contact object
func
UnmarshalContact
(
b
[]
byte
)
(
bind
.
Contact
,
error
)
{
func
UnmarshalContact
(
b
[]
byte
)
(
bind
.
Contact
,
error
)
{
return
contact
.
Unmarshal
(
b
)
return
contact
.
Unmarshal
(
b
)
}
}
// StartNetworkFollower kicks off the tracking of the network. It starts
// StartNetworkFollower kicks off the tracking of the network. It starts
// long running network client threads and returns an object for checking
// long running network client threads and returns an object for checking
// state and stopping those threads.
// state and stopping those threads.
...
@@ -132,14 +134,12 @@ func (c *Client) IsNetworkHealthy() bool {
...
@@ -132,14 +134,12 @@ func (c *Client) IsNetworkHealthy() bool {
return
c
.
api
.
GetHealth
()
.
IsHealthy
()
return
c
.
api
.
GetHealth
()
.
IsHealthy
()
}
}
// registers the network health callback to be called any time the network
// registers the network health callback to be called any time the network
// health changes
// health changes
func
(
c
*
Client
)
RegisterNetworkHealthCB
(
nhc
NetworkHealthCallback
)
{
func
(
c
*
Client
)
RegisterNetworkHealthCB
(
nhc
NetworkHealthCallback
)
{
c
.
api
.
GetHealth
()
.
AddFunc
(
nhc
.
Callback
)
c
.
api
.
GetHealth
()
.
AddFunc
(
nhc
.
Callback
)
}
}
// RegisterListener records and installs a listener for messages
// RegisterListener records and installs a listener for messages
// matching specific uid, msgType, and/or username
// matching specific uid, msgType, and/or username
// Returns a ListenerUnregister interface which can be
// Returns a ListenerUnregister interface which can be
...
...
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