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
7a6b4c8a
Commit
7a6b4c8a
authored
4 years ago
by
Benjamin Wenger
Browse files
Options
Downloads
Patches
Plain Diff
partially added prefix
parent
1e7552fe
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
storage/cmix/store.go
+7
-4
7 additions, 4 deletions
storage/cmix/store.go
storage/conversation/partner.go
+1
-2
1 addition, 2 deletions
storage/conversation/partner.go
storage/conversation/store.go
+3
-0
3 additions, 0 deletions
storage/conversation/store.go
with
11 additions
and
6 deletions
storage/cmix/store.go
+
7
−
4
View file @
7a6b4c8a
...
...
@@ -20,11 +20,12 @@ import (
"time"
)
const
prefix
=
"cmix"
const
currentStoreVersion
=
0
const
storeKey
=
"
cmix
KeyStore"
const
pubKeyKey
=
"
cmix
DhPubKey"
const
privKeyKey
=
"
cmix
DhPrivKey"
const
grpKey
=
"
cmix
GroupKey"
const
storeKey
=
"KeyStore"
const
pubKeyKey
=
"DhPubKey"
const
privKeyKey
=
"DhPrivKey"
const
grpKey
=
"GroupKey"
type
Store
struct
{
nodes
map
[
id
.
ID
]
*
key
...
...
@@ -42,6 +43,7 @@ type Store struct {
func
NewStore
(
grp
*
cyclic
.
Group
,
kv
*
versioned
.
KV
,
priv
*
cyclic
.
Int
)
(
*
Store
,
error
)
{
//generate public key
pub
:=
diffieHellman
.
GeneratePublicKey
(
priv
,
grp
)
kv
=
kv
.
Prefix
(
prefix
)
s
:=
&
Store
{
nodes
:
make
(
map
[
id
.
ID
]
*
key
),
...
...
@@ -75,6 +77,7 @@ func NewStore(grp *cyclic.Group, kv *versioned.KV, priv *cyclic.Int) (*Store, er
// loads the cmix storage object
func
LoadStore
(
kv
*
versioned
.
KV
)
(
*
Store
,
error
)
{
kv
=
kv
.
Prefix
(
prefix
)
s
:=
&
Store
{
nodes
:
make
(
map
[
id
.
ID
]
*
key
),
kv
:
kv
,
...
...
This diff is collapsed.
Click to expand it.
storage/conversation/partner.go
+
1
−
2
View file @
7a6b4c8a
...
...
@@ -13,7 +13,6 @@ import (
)
const
(
conversationKeyPrefix
=
"conversation"
currentConversationVersion
=
0
maxTruncatedID
=
math
.
MaxUint32
bottomRegion
=
maxTruncatedID
/
4
...
...
@@ -182,5 +181,5 @@ func (c *Conversation) marshal() ([]byte, error) {
}
func
makeConversationKey
(
partner
*
id
.
ID
)
string
{
return
conversationKeyPrefix
+
":"
+
partner
.
String
()
return
partner
.
String
()
}
This diff is collapsed.
Click to expand it.
storage/conversation/store.go
+
3
−
0
View file @
7a6b4c8a
...
...
@@ -6,6 +6,8 @@ import (
"sync"
)
const
conversationKeyPrefix
=
"conversation"
type
Store
struct
{
loadedConversations
map
[
id
.
ID
]
*
Conversation
kv
*
versioned
.
KV
...
...
@@ -14,6 +16,7 @@ type Store struct {
//Returns a new conversation store made off of the KV
func
NewStore
(
kv
*
versioned
.
KV
)
*
Store
{
kv
=
kv
.
Prefix
(
conversationKeyPrefix
)
return
&
Store
{
loadedConversations
:
make
(
map
[
id
.
ID
]
*
Conversation
),
kv
:
kv
,
...
...
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