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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elixxir
client
Merge requests
!360
Implement Notifications for bindings
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Implement Notifications for bindings
XX-4082/Notifications
into
release
Overview
0
Commits
5
Pipelines
0
Changes
1
Merged
Josh Brooks
requested to merge
XX-4082/Notifications
into
release
2 years ago
Overview
0
Commits
5
Pipelines
0
Changes
1
Expand
0
0
Merge request reports
Viewing commit
ed81d3ab
Prev
Next
Show latest version
1 file
+
48
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
ed81d3ab
Expose TrackServices to bindings
· ed81d3ab
Josh Brooks
authored
2 years ago
bindings/follow.go
+
48
−
0
Options
@@ -10,6 +10,7 @@ package bindings
import
(
"encoding/json"
"fmt"
"gitlab.com/elixxir/client/cmix/message"
"time"
"github.com/pkg/errors"
@@ -168,3 +169,50 @@ func (c *Cmix) RegisterClientErrorCallback(clientError ClientError) {
}
}()
}
// TrackServicesCallback is the callback for Cmix.TrackServices.
// This will pass to the user a JSON-marshalled list of backend services.
// If there was an error retrieving or marshalling the service list,
// there is an error for the second parameter which will be non-null.
//
// Example JSON:
//
// [
// {
// "Id": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD",
// "Services": [
// {
// "Identifier": null,
// "Tag": "test",
// "Metadata": null
// }
// ]
// },
// {
// "Id": "AAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD",
// "Services": [
// {
// "Identifier": null,
// "Tag": "test",
// "Metadata": null
// }
// ]
// },
//]
type
TrackServicesCallback
interface
{
Callback
(
marshalData
[]
byte
,
err
error
)
}
// TrackServices will return via a callback the list of services the
// backend keeps track of, which is formally referred to as a
// [message.ServiceList]. This may be passed into other bindings call which
// may need context on the available services for this client.
//
// Parameters:
// - cb - A TrackServicesCallback, which will be passed the marshalled
// message.ServiceList.
func
(
c
*
Cmix
)
TrackServices
(
cb
TrackServicesCallback
)
{
c
.
api
.
GetCmix
()
.
TrackServices
(
func
(
list
message
.
ServiceList
)
{
cb
.
Callback
(
json
.
Marshal
(
list
))
})
}
Loading