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
741fa29c
Commit
741fa29c
authored
Mar 22, 2022
by
Josh Brooks
Browse files
Options
Downloads
Patches
Plain Diff
Implmenet cleanup and constructor for triggers.go
parent
c9b4514e
Branches
Branches containing commit
Tags
Tags containing commit
4 merge requests
!510
Release
,
!207
WIP: Client Restructure
,
!203
Symmetric broadcast
,
!187
Xx 3829/triggers
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
network/message/triggers.go
+3
-7
3 additions, 7 deletions
network/message/triggers.go
with
3 additions
and
7 deletions
network/message/triggers.go
+
3
−
7
View file @
741fa29c
...
@@ -48,7 +48,9 @@ type trigger struct {
...
@@ -48,7 +48,9 @@ type trigger struct {
func
NewTriggers
()
*
TriggersManager
{
func
NewTriggers
()
*
TriggersManager
{
// todo: implement me
// todo: implement me
return
nil
return
&
TriggersManager
{
tmap
:
make
(
map
[
id
.
ID
]
map
[
interfaces
.
Preimage
][]
trigger
,
0
),
}
}
}
// Lookup will see if a trigger exists for the given preimage and message
// Lookup will see if a trigger exists for the given preimage and message
...
@@ -59,12 +61,6 @@ func NewTriggers() *TriggersManager {
...
@@ -59,12 +61,6 @@ func NewTriggers() *TriggersManager {
// that one or multiple triggers exist to process this message.
// that one or multiple triggers exist to process this message.
// These triggers are returned to the caller along with the a true boolean.
// These triggers are returned to the caller along with the a true boolean.
// If the map has been exhausted with no matches found, it returns nil and false.
// If the map has been exhausted with no matches found, it returns nil and false.
// TODO: reorganize this interface. Lookup needs to be called by handleMessage,
// which should not have access to the other state modifying methods below.
// Possible options include:
// - privatizing the state-changing methods
// - leaking lookup on this layer and migrating the state modification methods
// a layer down in a separate package
func
(
t
*
TriggersManager
)
get
(
clientID
*
id
.
ID
,
receivedIdentityFp
,
func
(
t
*
TriggersManager
)
get
(
clientID
*
id
.
ID
,
receivedIdentityFp
,
ecrMsgContents
[]
byte
)
([]
trigger
,
ecrMsgContents
[]
byte
)
([]
trigger
,
bool
)
{
bool
)
{
...
...
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