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
9b6db62d
Commit
9b6db62d
authored
Aug 30, 2022
by
Benjamin Wenger
Browse files
Options
Downloads
Patches
Plain Diff
added a channels package docstring
parent
e442a896
No related branches found
No related tags found
5 merge requests
!510
Release
,
!419
rewrote the health tracker to both consider if there are waiting rounds and...
,
!371
[Channel RSAtoPrivate] Implement Reverse Asymmetric in Client/Broadcast
,
!354
Channels impl
,
!340
Project/channels
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
channels/errors.go
+2
-0
2 additions, 0 deletions
channels/errors.go
channels/eventModel.go
+4
-6
4 additions, 6 deletions
channels/eventModel.go
channels/interface.go
+4
-0
4 additions, 0 deletions
channels/interface.go
channels/manager.go
+3
-0
3 additions, 0 deletions
channels/manager.go
with
13 additions
and
6 deletions
channels/errors.go
+
2
−
0
View file @
9b6db62d
...
@@ -18,4 +18,6 @@ var (
...
@@ -18,4 +18,6 @@ var (
"the passed message is too long"
)
"the passed message is too long"
)
WrongPrivateKey
=
errors
.
New
(
WrongPrivateKey
=
errors
.
New
(
"the passed private key does not match the channel"
)
"the passed private key does not match the channel"
)
MessageTypeAlreadyRegistered
=
errors
.
New
(
"the given message type has "
+
"already been registered"
)
)
)
This diff is collapsed.
Click to expand it.
channels/eventModel.go
+
4
−
6
View file @
9b6db62d
...
@@ -8,7 +8,6 @@
...
@@ -8,7 +8,6 @@
package
channels
package
channels
import
(
import
(
"errors"
"github.com/golang/protobuf/proto"
"github.com/golang/protobuf/proto"
jww
"github.com/spf13/jwalterweatherman"
jww
"github.com/spf13/jwalterweatherman"
"gitlab.com/elixxir/client/cmix/identity/receptionID"
"gitlab.com/elixxir/client/cmix/identity/receptionID"
...
@@ -22,13 +21,10 @@ import (
...
@@ -22,13 +21,10 @@ import (
"gitlab.com/xx_network/primitives/id"
"gitlab.com/xx_network/primitives/id"
)
)
// AdminUsername defines the displayed username of admin messages, which are
// unique users for every channel defined by the channel's private key
const
AdminUsername
=
"Admin"
const
AdminUsername
=
"Admin"
var
(
MessageTypeAlreadyRegistered
=
errors
.
New
(
"the given message type has "
+
"already been registered"
)
)
// EventModel is an interface which an external party which uses the channels
// EventModel is an interface which an external party which uses the channels
// system passed an object which adheres to in order to get events on the channel
// system passed an object which adheres to in order to get events on the channel
type
EventModel
interface
{
type
EventModel
interface
{
...
@@ -72,6 +68,8 @@ type EventModel interface {
...
@@ -72,6 +68,8 @@ type EventModel interface {
//UnPinMessage(ChannelID *id.ID, MessageID cryptoChannel.MessageID)
//UnPinMessage(ChannelID *id.ID, MessageID cryptoChannel.MessageID)
}
}
// MessageTypeReceiveMessage defines handlers for messages of various message
// types. Default ones for Text, Reaction, and AdminText.
type
MessageTypeReceiveMessage
func
(
channelID
*
id
.
ID
,
type
MessageTypeReceiveMessage
func
(
channelID
*
id
.
ID
,
messageID
cryptoChannel
.
MessageID
,
messageType
MessageType
,
messageID
cryptoChannel
.
MessageID
,
messageType
MessageType
,
senderUsername
string
,
content
[]
byte
,
timestamp
time
.
Time
,
senderUsername
string
,
content
[]
byte
,
timestamp
time
.
Time
,
...
...
This diff is collapsed.
Click to expand it.
channels/interface.go
+
4
−
0
View file @
9b6db62d
...
@@ -17,6 +17,10 @@ import (
...
@@ -17,6 +17,10 @@ import (
"time"
"time"
)
)
// ValidForever is used as a validUntil lease when sending to denote the
// message or operation never expires. Note: A message relay must be
// present to enforce this otherwise things expire after 3 weeks due to
// network retention.
var
ValidForever
=
time
.
Duration
(
math
.
MaxInt64
)
var
ValidForever
=
time
.
Duration
(
math
.
MaxInt64
)
type
Manager
interface
{
type
Manager
interface
{
...
...
This diff is collapsed.
Click to expand it.
channels/manager.go
+
3
−
0
View file @
9b6db62d
...
@@ -5,6 +5,9 @@
...
@@ -5,6 +5,9 @@
// LICENSE file //
// LICENSE file //
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// Package channels provides a channels implementation on top of broadcast
// which is capable of handing the user facing features of channels, including
// replies, reactions, and eventually admin commands.
package
channels
package
channels
import
(
import
(
...
...
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