Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
X
xxdk-wasm
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
xxdk-wasm
Commits
56571f6b
Commit
56571f6b
authored
2 years ago
by
Richard T. Carback III
Committed by
Jono Wenger
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Update model to include User's cryptographic Identity and link it to the Messages table
parent
b4f099f9
No related branches found
No related tags found
2 merge requests
!60
Revert "Fail a test to be sure it works"
,
!8
Updates to match the client fullyDecentrilizedChannels branch
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
indexedDb/model.go
+27
-1
27 additions, 1 deletion
indexedDb/model.go
with
27 additions
and
1 deletion
indexedDb/model.go
+
27
−
1
View file @
56571f6b
...
@@ -20,15 +20,21 @@ const (
...
@@ -20,15 +20,21 @@ const (
// Text representation of the names of the various [idb.ObjectStore].
// Text representation of the names of the various [idb.ObjectStore].
messageStoreName
=
"messages"
messageStoreName
=
"messages"
channelsStoreName
=
"channels"
channelsStoreName
=
"channels"
userStoreName
=
"users"
// Message index names.
// Message index names.
messageStoreChannelIndex
=
"channel_id_index"
messageStoreChannelIndex
=
"channel_id_index"
messageStoreUserIndex
=
"user_id_index"
messageStoreParentIndex
=
"parent_message_id_index"
messageStoreParentIndex
=
"parent_message_id_index"
messageStoreTimestampIndex
=
"timestamp_index"
messageStoreTimestampIndex
=
"timestamp_index"
messageStorePinnedIndex
=
"pinned_index"
messageStorePinnedIndex
=
"pinned_index"
// UserIdentity index names.
userStorePubkeyIndex
=
"pubkey_index"
// Message keyPath names (must match json struct tags).
// Message keyPath names (must match json struct tags).
messageStoreChannel
=
"channel_id"
messageStoreChannel
=
"channel_id"
messageStoreUser
=
"user_id"
messageStoreParent
=
"parent_message_id"
messageStoreParent
=
"parent_message_id"
messageStoreTimestamp
=
"timestamp"
messageStoreTimestamp
=
"timestamp"
messageStorePinned
=
"pinned"
messageStorePinned
=
"pinned"
...
@@ -39,10 +45,14 @@ const (
...
@@ -39,10 +45,14 @@ const (
// A Message belongs to one Channel.
// A Message belongs to one Channel.
//
//
// A Message may belong to one Message (Parent).
// A Message may belong to one Message (Parent).
//
// A Message belongs to one User (cryptographic identity).
// The user's nickname can change each message.
type
Message
struct
{
type
Message
struct
{
Id
[]
byte
`json:"id"`
// Matches pkeyName
Id
[]
byte
`json:"id"`
// Matches pkeyName
SenderUsername
string
`json:"
sender_user
name"`
Nickname
string
`json:"
nick
name"`
ChannelId
[]
byte
`json:"channel_id"`
// Index
ChannelId
[]
byte
`json:"channel_id"`
// Index
UserId
[]
byte
`json:"user_id"`
// Index
ParentMessageId
[]
byte
`json:"parent_message_id"`
// Index
ParentMessageId
[]
byte
`json:"parent_message_id"`
// Index
Timestamp
time
.
Time
`json:"timestamp"`
// Index
Timestamp
time
.
Time
`json:"timestamp"`
// Index
Lease
time
.
Duration
`json:"lease"`
Lease
time
.
Duration
`json:"lease"`
...
@@ -60,3 +70,19 @@ type Channel struct {
...
@@ -60,3 +70,19 @@ type Channel struct {
Name
string
`json:"name"`
Name
string
`json:"name"`
Description
string
`json:"description"`
Description
string
`json:"description"`
}
}
// User defines the IndexedDb representation of a single user's
// cryptographic identity
//
// A User has many Message.
type
User
struct
{
Id
[]
byte
`json:"id"`
// Matches pkeyName
Pubkey
[]
byte
`json:"pubkey"`
//Index
Honorific
string
`json:"honorific"`
Adjective
string
`json:"adjective"`
Noun
string
`json:"noun"`
Codename
string
`json:"codename"`
Color
string
`json:"color"`
Extension
string
`json:"extension"`
CodesetVersion
uint8
`json:"codeset_version"`
}
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