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
7f900285
Commit
7f900285
authored
4 years ago
by
Jono Wenger
Browse files
Options
Downloads
Patches
Plain Diff
Remove reception storage from single.NewManager
parent
4b97f64a
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
cmd/single.go
+1
-1
1 addition, 1 deletion
cmd/single.go
single/manager.go
+5
-1
5 additions, 1 deletion
single/manager.go
single/manager_test.go
+2
-2
2 additions, 2 deletions
single/manager_test.go
with
8 additions
and
4 deletions
cmd/single.go
+
1
−
1
View file @
7f900285
...
@@ -72,7 +72,7 @@ var singleCmd = &cobra.Command{
...
@@ -72,7 +72,7 @@ var singleCmd = &cobra.Command{
waitUntilConnected
(
connected
)
waitUntilConnected
(
connected
)
// Make single-use manager and start receiving process
// Make single-use manager and start receiving process
singleMng
:=
single
.
NewManager
(
client
,
client
.
GetStorage
()
.
Reception
()
)
singleMng
:=
single
.
NewManager
(
client
)
// Register the callback
// Register the callback
callbackChan
:=
make
(
chan
responseCallbackChan
)
callbackChan
:=
make
(
chan
responseCallbackChan
)
...
...
This diff is collapsed.
Click to expand it.
single/manager.go
+
5
−
1
View file @
7f900285
...
@@ -50,7 +50,11 @@ type Manager struct {
...
@@ -50,7 +50,11 @@ type Manager struct {
}
}
// NewManager creates a new single-use communication manager.
// NewManager creates a new single-use communication manager.
func
NewManager
(
client
*
api
.
Client
,
reception
*
reception
.
Store
)
*
Manager
{
func
NewManager
(
client
*
api
.
Client
)
*
Manager
{
return
newManager
(
client
,
client
.
GetStorage
()
.
Reception
())
}
func
newManager
(
client
*
api
.
Client
,
reception
*
reception
.
Store
)
*
Manager
{
return
&
Manager
{
return
&
Manager
{
client
:
client
,
client
:
client
,
store
:
client
.
GetStorage
(),
store
:
client
.
GetStorage
(),
...
...
This diff is collapsed.
Click to expand it.
single/manager_test.go
+
2
−
2
View file @
7f900285
...
@@ -39,13 +39,13 @@ import (
...
@@ -39,13 +39,13 @@ import (
)
)
// Happy path.
// Happy path.
func
Test
N
ewManager
(
t
*
testing
.
T
)
{
func
Test
_n
ewManager
(
t
*
testing
.
T
)
{
client
:=
&
api
.
Client
{}
client
:=
&
api
.
Client
{}
e
:=
&
Manager
{
e
:=
&
Manager
{
client
:
client
,
client
:
client
,
p
:
newPending
(),
p
:
newPending
(),
}
}
m
:=
N
ewManager
(
client
,
reception
.
New
Store
(
versioned
.
NewKV
(
make
(
ekv
.
Memstore
)))
)
m
:=
n
ewManager
(
client
,
&
reception
.
Store
{}
)
if
e
.
client
!=
m
.
client
||
e
.
store
!=
m
.
store
||
e
.
net
!=
m
.
net
||
if
e
.
client
!=
m
.
client
||
e
.
store
!=
m
.
store
||
e
.
net
!=
m
.
net
||
e
.
rng
!=
m
.
rng
||
!
reflect
.
DeepEqual
(
e
.
p
,
m
.
p
)
{
e
.
rng
!=
m
.
rng
||
!
reflect
.
DeepEqual
(
e
.
p
,
m
.
p
)
{
...
...
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