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
1a6f587a
Commit
1a6f587a
authored
2 years ago
by
Jake Taylor
Browse files
Options
Downloads
Patches
Plain Diff
update bindings docs
parent
72ec36a6
No related branches found
No related tags found
1 merge request
!510
Release
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bindings/connect.go
+0
-11
0 additions, 11 deletions
bindings/connect.go
bindings/e2eHandler.go
+30
-11
30 additions, 11 deletions
bindings/e2eHandler.go
with
30 additions
and
22 deletions
bindings/connect.go
+
0
−
11
View file @
1a6f587a
...
...
@@ -52,17 +52,6 @@ func (c *Cmix) Connect(e2eId int, recipientContact []byte) (
return
connectionTrackerSingleton
.
make
(
connection
),
nil
}
// E2ESendReport is the bindings representation of the return values of SendE2E
// Example E2ESendReport:
// {"Rounds":[1,5,9],
// "MessageID":"51Yy47uZbP0o2Y9B/kkreDLTB6opUol3M3mYiY2dcdQ=",
// "Timestamp":1653582683183384000}
type
E2ESendReport
struct
{
RoundsList
MessageID
[]
byte
Timestamp
int64
}
// SendE2E is a wrapper for sending specifically to the Connection's partner.Manager
// Returns marshalled E2ESendReport
func
(
c
*
Connection
)
SendE2E
(
mt
int
,
payload
[]
byte
)
([]
byte
,
error
)
{
...
...
This diff is collapsed.
Click to expand it.
bindings/e2eHandler.go
+
30
−
11
View file @
1a6f587a
...
...
@@ -18,13 +18,28 @@ type IdList struct {
Ids
[][]
byte
}
// E2ESendReport is the bindings representation of the return values of SendE2E
// Example E2ESendReport:
// {"Rounds":[1,5,9],
// "MessageID":"51Yy47uZbP0o2Y9B/kkreDLTB6opUol3M3mYiY2dcdQ=",
// "Timestamp":1653582683183384000}
type
E2ESendReport
struct
{
RoundsList
MessageID
[]
byte
Timestamp
int64
}
// GetReceptionID returns the marshalled default IDs
// Returns:
// - []byte - the marshalled bytes of the id.ID object.
func
(
e
*
E2e
)
GetReceptionID
()
[]
byte
{
return
e
.
api
.
GetE2E
()
.
GetReceptionID
()
.
Marshal
()
}
// GetAllPartnerIDs returns a marshalled list of all partner IDs that the user has
// an E2E relationship with.
// Returns:
// - []byte - the marshalled bytes of the IdList object.
func
(
e
*
E2e
)
GetAllPartnerIDs
()
([]
byte
,
error
)
{
partnerIds
:=
e
.
api
.
GetE2E
()
.
GetAllPartnerIDs
()
convertedIds
:=
make
([][]
byte
,
len
(
partnerIds
))
...
...
@@ -59,18 +74,24 @@ func (e *E2e) FirstPartitionSize() int {
}
// GetHistoricalDHPrivkey returns the user's marshalled Historical DH Private Key
// Returns:
// - []byte - the marshalled bytes of the cyclic.Int object.
func
(
e
*
E2e
)
GetHistoricalDHPrivkey
()
([]
byte
,
error
)
{
return
e
.
api
.
GetE2E
()
.
GetHistoricalDHPrivkey
()
.
MarshalJSON
()
}
// GetHistoricalDHPubkey returns the user's marshalled Historical DH
// Public Key
// Returns:
// - []byte - the marshalled bytes of the cyclic.Int object.
func
(
e
*
E2e
)
GetHistoricalDHPubkey
()
([]
byte
,
error
)
{
return
e
.
api
.
GetE2E
()
.
GetHistoricalDHPubkey
()
.
MarshalJSON
()
}
// HasAuthenticatedChannel returns true if an authenticated channel with the
// partner exists, otherwise returns false
// Parameters:
// - partnerId - the marshalled bytes of the id.ID object.
func
(
e
*
E2e
)
HasAuthenticatedChannel
(
partnerId
[]
byte
)
(
bool
,
error
)
{
partner
,
err
:=
id
.
Unmarshal
(
partnerId
)
if
err
!=
nil
{
...
...
@@ -88,6 +109,11 @@ func (e *E2e) RemoveService(tag string) error {
// recipient of the passed message type, per the given
// parameters - encrypted with end-to-end encryption.
// Default parameters can be retrieved through
// Parameters:
// - recipientId - the marshalled bytes of the id.ID object.
// - e2eParams - the marshalled bytes of the e2e.Params object.
// Returns:
// - []byte - the marshalled bytes of the E2ESendReport object.
func
(
e
*
E2e
)
SendE2E
(
messageType
int
,
recipientId
,
payload
,
e2eParams
[]
byte
)
([]
byte
,
error
)
{
...
...
@@ -106,17 +132,10 @@ func (e *E2e) SendE2E(messageType int, recipientId, payload,
return
nil
,
err
}
result
:=
Send
E2eResults
{
r
ound
Ids
:
roundIds
,
m
essageI
d
:
messageId
.
Marshal
(),
ts
:
ts
.
UnixNano
(),
result
:=
E2E
Send
Report
{
R
ound
sList
:
makeRoundsList
(
roundIds
)
,
M
essageI
D
:
messageId
.
Marshal
(),
Timestamp
:
ts
.
UnixNano
(),
}
return
json
.
Marshal
(
result
)
}
// SendE2eResults is the return type for SendE2e
type
SendE2eResults
struct
{
roundIds
[]
id
.
Round
messageId
[]
byte
ts
int64
}
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