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
Commits
930e66a0
Commit
930e66a0
authored
2 years ago
by
Josh Brooks
Browse files
Options
Downloads
Patches
Plain Diff
Add more documentation
parent
fed0850c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
3 merge requests
!510
Release
,
!419
rewrote the health tracker to both consider if there are waiting rounds and...
,
!340
Project/channels
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bindings/channels.go
+16
-12
16 additions, 12 deletions
bindings/channels.go
with
16 additions
and
12 deletions
bindings/channels.go
+
16
−
12
View file @
930e66a0
...
...
@@ -740,6 +740,10 @@ func (cm *ChannelsManager) RegisterReceiveHandler(messageType int,
return
cm
.
api
.
RegisterReceiveHandler
(
channels
.
MessageType
(
messageType
),
cb
)
}
////////////////////////////////////////////////////////////////////////////////
// Event Model Logic //
////////////////////////////////////////////////////////////////////////////////
// EventModel is an interface which an external party which uses the channels
// system passed an object which adheres to in order to get events on the channel.
type
EventModel
interface
{
...
...
@@ -770,9 +774,9 @@ type EventModel interface {
// - Lease is a number of nanoseconds that the message is valid for.
// - Status is the status of the message.
// Statuses will be enumerated as such:
// Sent
-
0
// Delivered
-
1
// Failed
-
2
// Sent
|
0
// Delivered
|
1
// Failed
|
2
ReceiveMessage
(
channelID
[]
byte
,
messageID
[]
byte
,
senderUsername
string
,
text
string
,
timestamp
int64
,
lease
int64
,
roundId
int64
,
status
int64
)
...
...
@@ -794,9 +798,9 @@ type EventModel interface {
// - Lease is a number of nanoseconds that the message is valid for.
// - Status is the status of the message.
// Statuses will be enumerated as such:
// Sent
-
0
// Delivered
-
1
// Failed
-
2
// Sent
|
0
// Delivered
|
1
// Failed
|
2
ReceiveReply
(
channelID
[]
byte
,
messageID
[]
byte
,
reactionTo
[]
byte
,
senderUsername
string
,
text
string
,
timestamp
int64
,
lease
int64
,
...
...
@@ -808,7 +812,7 @@ type EventModel interface {
// Messages may arrive our of order, so a reply in theory can arrive before
// the initial message, as a result it may be important to buffer reactions.
//
// Parameters:
//todo: enumerate all arguments
// Parameters:
// - ChannelID is the marshalled channel ID.
// - MessageID is the marshalled message ID of the received message.
// - reactionTo is the message ID for the message that received a reaction.
...
...
@@ -819,9 +823,9 @@ type EventModel interface {
// - Lease is a number of nanoseconds that the message is valid for.
// - Status is the status of the message.
// Statuses will be enumerated as such:
// Sent
-
0
// Delivered
-
1
// Failed
-
2
// Sent
|
0
// Delivered
|
1
// Failed
|
2
ReceiveReaction
(
channelID
[]
byte
,
messageID
[]
byte
,
reactionTo
[]
byte
,
senderUsername
string
,
reaction
string
,
timestamp
int64
,
lease
int64
,
...
...
@@ -849,8 +853,8 @@ type toEventModel struct {
em
EventModel
}
// NewEventModel is a constructor for a toEventModel. This will take in
the
//
passed
EventModel and wraps it.
// NewEventModel is a constructor for a toEventModel. This will take in
an
// EventModel and wraps it
around the toEventModel
.
func
NewEventModel
(
em
EventModel
)
*
toEventModel
{
return
&
toEventModel
{
em
:
em
}
}
...
...
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