Skip to content
Snippets Groups Projects
Commit cf5c716e authored by Jono Wenger's avatar Jono Wenger
Browse files

Merge remote-tracking branch 'origin/release' into project/adminCommands

# Conflicts:
#	go.mod
#	go.sum
parents 5647adef e5590a3f
No related branches found
No related tags found
2 merge requests!60Revert "Fail a test to be sure it works",!32Admin Commands
......@@ -7,7 +7,7 @@ require (
github.com/hack-pad/go-indexeddb v0.2.0
github.com/pkg/errors v0.9.1
github.com/spf13/jwalterweatherman v1.1.0
gitlab.com/elixxir/client/v4 v4.3.9-0.20221122010204-41d091b9b031
gitlab.com/elixxir/client/v4 v4.3.9-0.20221117174054-7a48e9fb3283
gitlab.com/elixxir/crypto v0.0.7-0.20221121233335-83f145891bc7
gitlab.com/elixxir/primitives v0.0.3-0.20221114231218-cc461261a6af
gitlab.com/xx_network/crypto v0.0.5-0.20221121220724-8eefdbb0eb46
......
......@@ -369,8 +369,8 @@ github.com/zeebo/pcg v1.0.1 h1:lyqfGeWiv4ahac6ttHs+I5hwtH/+1mrhlCtVNQM2kHo=
github.com/zeebo/pcg v1.0.1/go.mod h1:09F0S9iiKrwn9rlI5yjLkmrug154/YRW6KnnXVDM/l4=
gitlab.com/elixxir/bloomfilter v0.0.0-20211222005329-7d931ceead6f h1:yXGvNBqzZwAhDYlSnxPRbgor6JWoOt1Z7s3z1O9JR40=
gitlab.com/elixxir/bloomfilter v0.0.0-20211222005329-7d931ceead6f/go.mod h1:H6jztdm0k+wEV2QGK/KYA+MY9nj9Zzatux/qIvDDv3k=
gitlab.com/elixxir/client/v4 v4.3.9-0.20221122010204-41d091b9b031 h1:p4EkUqPNSwC6cbCd2ulqyH7J5M+ZGXmWeLDNuF+wa0M=
gitlab.com/elixxir/client/v4 v4.3.9-0.20221122010204-41d091b9b031/go.mod h1:e2EC5b3ucHaVeR9DjGcoKNnDBbVPPPG2dHtpPGDrFhM=
gitlab.com/elixxir/client/v4 v4.3.9-0.20221117174054-7a48e9fb3283 h1:TYsCqI18+g4DgENJoFahnQFQKBZwg/t5XgYMCBV5e5M=
gitlab.com/elixxir/client/v4 v4.3.9-0.20221117174054-7a48e9fb3283/go.mod h1:4jD++3DAylNUM4BL5+wEIoe+oAvkbnc//wjCgnhyKpw=
gitlab.com/elixxir/comms v0.0.4-0.20221110181420-84bca6216fe4 h1:bLRjVCyMVde4n2hTVgoyyIAWrKI4CevpChchkPeb6A0=
gitlab.com/elixxir/comms v0.0.4-0.20221110181420-84bca6216fe4/go.mod h1:XhI2/CMng+xcH3mAs+1aPz29PSNu1079XMJ8V+xxihw=
gitlab.com/elixxir/crypto v0.0.7-0.20221121233335-83f145891bc7 h1:yhc8jQ27JKypdRE41NpfJPaYRS0sNkOwugaIyoscDiU=
......
......@@ -53,6 +53,7 @@ func newCmixJS(api *bindings.Cmix) map[string]interface{} {
"AddHealthCallback": js.FuncOf(c.AddHealthCallback),
"RemoveHealthCallback": js.FuncOf(c.RemoveHealthCallback),
"RegisterClientErrorCallback": js.FuncOf(c.RegisterClientErrorCallback),
"TrackServicesWithIdentity": js.FuncOf(c.TrackServicesWithIdentity),
"TrackServices": js.FuncOf(c.TrackServices),
// connect.go
......
......@@ -118,6 +118,7 @@ func (c *Cmix) ReadyToSend(js.Value, []js.Value) interface{} {
// NetworkFollowerStatus gets the state of the network follower. It returns a
// status with the following values:
//
// Stopped - 0
// Running - 2000
// Stopping - 3000
......@@ -234,8 +235,10 @@ func (c *Cmix) IsHealthy(js.Value, []js.Value) interface{} {
//
// Returns:
// - JSON of strings (Uint8Array).
// - Throws TypeError if getting the processes fails.
//
// JSON Example:
//
// {
// "FileTransfer{BatchBuilderThread, FilePartSendingThread#0, FilePartSendingThread#1, FilePartSendingThread#2, FilePartSendingThread#3}",
// "MessageReception Worker 0"
......@@ -325,6 +328,7 @@ type trackServicesCallback struct {
// - err - Returns an error on failure (Error).
//
// Example JSON:
//
// [
// {
// "Id": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD", // bytes of id.ID encoded as base64 string
......@@ -351,6 +355,29 @@ func (tsc *trackServicesCallback) Callback(marshalData []byte, err error) {
tsc.callback(utils.CopyBytesToJS(marshalData), utils.JsTrace(err))
}
// TrackServicesWithIdentity will return via a callback the list of services the
// backend keeps track of for the provided identity. This may be passed into
// other bindings call which may need context on the available services for this
// single identity. This will only return services for the given identity.
//
// Parameters:
// - args[0] - ID of [E2e] object in tracker (int).
// - args[1] - Javascript object that has functions that implement the
// [bindings.ClientError] interface.
//
// Returns:
// - Throws TypeError if the [E2e] ID is invalid.
func (c *Cmix) TrackServicesWithIdentity(_ js.Value, args []js.Value) interface{} {
err := c.api.TrackServicesWithIdentity(args[0].Int(),
&trackServicesCallback{utils.WrapCB(args[0], "Callback")})
if err != nil {
utils.Throw(utils.TypeError, err)
return nil
}
return nil
}
// TrackServices will return, via a callback, the list of services that the
// backend keeps track of, which is formally referred to as a
// [message.ServiceList]. This may be passed into other bindings call that may
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment