Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
quant
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
danet
quant
Commits
0b0afeac
Commit
0b0afeac
authored
1 year ago
by
Malte Bauch
Browse files
Options
Downloads
Patches
Plain Diff
Add AssignForwardingRoute method to KMS
parent
73911013
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!1
Move proto kms into ekms
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
internal/kms/kms.go
+31
-0
31 additions, 0 deletions
internal/kms/kms.go
with
31 additions
and
0 deletions
internal/kms/kms.go
+
31
−
0
View file @
0b0afeac
...
@@ -220,6 +220,37 @@ func (kms *EKMS) AddPeer(kmsPeerSocket string, servingQLE *QuantumElement) (*kms
...
@@ -220,6 +220,37 @@ func (kms *EKMS) AddPeer(kmsPeerSocket string, servingQLE *QuantumElement) (*kms
return
peer
,
nil
return
peer
,
nil
}
}
func
(
kms
*
EKMS
)
AssignForwardingRoute
(
pId
,
pHop
,
nHop
string
)
error
{
pathId
,
err
:=
uuid
.
Parse
(
pId
)
if
err
!=
nil
{
return
fmt
.
Errorf
(
"The given path id %s is no uuid; err = "
,
pathId
,
err
)
}
var
previousHop
*
kmsPeer
var
nextHop
*
kmsPeer
var
ok
bool
if
pHop
!=
""
{
previousHop
,
ok
=
kms
.
KmsPeers
[
pHop
]
if
!
ok
{
return
fmt
.
Errorf
(
"No peer found for %s"
,
pHop
)
}
}
if
nHop
!=
""
{
nextHop
,
ok
=
kms
.
KmsPeers
[
nHop
]
if
!
ok
{
return
fmt
.
Errorf
(
"No peer found for %s"
,
nHop
)
}
}
// set the route within routing table
kms
.
routingTable
[
pathId
]
=
&
Route
{
Previous
:
previousHop
,
Next
:
nextHop
,
}
return
nil
}
// TODO/XXX error handling
// TODO/XXX error handling
func
(
kms
*
EKMS
)
RemovePeer
(
kmsPeerSocket
string
)
{
func
(
kms
*
EKMS
)
RemovePeer
(
kmsPeerSocket
string
)
{
if
_
,
there
:=
kms
.
KmsPeers
[
kmsPeerSocket
];
there
{
if
_
,
there
:=
kms
.
KmsPeers
[
kmsPeerSocket
];
there
{
...
...
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