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
547a2b56
Commit
547a2b56
authored
3 years ago
by
Richard T. Carback III
Browse files
Options
Downloads
Patches
Plain Diff
Add URL to dashboard functionality for round IDs
parent
74dba3c6
No related branches found
No related tags found
2 merge requests
!170
Release
,
!134
Add URL to dashboard functionality for round IDs
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
bindings/group.go
+10
-0
10 additions, 0 deletions
bindings/group.go
bindings/message.go
+5
-0
5 additions, 0 deletions
bindings/message.go
bindings/send.go
+7
-0
7 additions, 0 deletions
bindings/send.go
bindings/url.go
+20
-0
20 additions, 0 deletions
bindings/url.go
with
42 additions
and
0 deletions
bindings/group.go
+
10
−
0
View file @
547a2b56
...
@@ -263,6 +263,11 @@ func (gsr *GroupSendReport) GetMessageID() []byte {
...
@@ -263,6 +263,11 @@ func (gsr *GroupSendReport) GetMessageID() []byte {
return
gsr
.
messageID
[
:
]
return
gsr
.
messageID
[
:
]
}
}
// GetRoundURL returns the URL of the round that the send occurred on.
func
(
gsr
*
GroupSendReport
)
GetRoundURL
()
string
{
return
getRoundURL
(
gsr
.
roundID
)
}
////
////
// Group Structure
// Group Structure
////
////
...
@@ -413,6 +418,11 @@ func (gmr *GroupMessageReceive) GetRoundID() int64 {
...
@@ -413,6 +418,11 @@ func (gmr *GroupMessageReceive) GetRoundID() int64 {
return
int64
(
gmr
.
RoundID
)
return
int64
(
gmr
.
RoundID
)
}
}
// GetRoundURL returns the ID of the round the message was sent on.
func
(
gmr
*
GroupMessageReceive
)
GetRoundURL
()
string
{
return
getRoundURL
(
gmr
.
RoundID
)
}
// GetRoundTimestampNano returns the timestamp, in nanoseconds, of the round the
// GetRoundTimestampNano returns the timestamp, in nanoseconds, of the round the
// message was sent on.
// message was sent on.
func
(
gmr
*
GroupMessageReceive
)
GetRoundTimestampNano
()
int64
{
func
(
gmr
*
GroupMessageReceive
)
GetRoundTimestampNano
()
int64
{
...
...
This diff is collapsed.
Click to expand it.
bindings/message.go
+
5
−
0
View file @
547a2b56
...
@@ -65,3 +65,8 @@ func (m *Message) GetRoundTimestampNano() int64 {
...
@@ -65,3 +65,8 @@ func (m *Message) GetRoundTimestampNano() int64 {
func
(
m
*
Message
)
GetRoundId
()
int64
{
func
(
m
*
Message
)
GetRoundId
()
int64
{
return
int64
(
m
.
r
.
RoundId
)
return
int64
(
m
.
r
.
RoundId
)
}
}
// GetRoundURL returns the message's round URL
func
(
m
*
Message
)
GetRoundURL
()
string
{
return
getRoundURL
(
m
.
r
.
RoundId
)
}
This diff is collapsed.
Click to expand it.
bindings/send.go
+
7
−
0
View file @
547a2b56
...
@@ -199,6 +199,13 @@ func (sr *SendReport) GetMessageID() []byte {
...
@@ -199,6 +199,13 @@ func (sr *SendReport) GetMessageID() []byte {
return
sr
.
mid
[
:
]
return
sr
.
mid
[
:
]
}
}
func
(
sr
*
SendReport
)
GetRoundURL
()
string
{
if
sr
.
rl
!=
nil
&&
sr
.
rl
.
Len
()
>
0
{
return
getRoundURL
(
sr
.
rl
.
list
[
0
])
}
return
dashboardBaseURL
}
// GetTimestampMS returns the message's timestamp in milliseconds
// GetTimestampMS returns the message's timestamp in milliseconds
func
(
sr
*
SendReport
)
GetTimestampMS
()
int64
{
func
(
sr
*
SendReport
)
GetTimestampMS
()
int64
{
ts
:=
sr
.
ts
.
UnixNano
()
ts
:=
sr
.
ts
.
UnixNano
()
...
...
This diff is collapsed.
Click to expand it.
bindings/url.go
0 → 100644
+
20
−
0
View file @
547a2b56
///////////////////////////////////////////////////////////////////////////////
// Copyright © 2020 xx network SEZC //
// //
// Use of this source code is governed by a license that can be found in the //
// LICENSE file //
///////////////////////////////////////////////////////////////////////////////
package
bindings
import
(
"gitlab.com/xx_network/primitives/id"
"fmt"
)
const
dashboardBaseURL
=
"https://dashboard.xx.network"
func
getRoundURL
(
round
id
.
Round
)
string
{
return
fmt
.
Sprintf
(
"%s/rounds/%d"
,
dashboardBaseURL
,
round
)
}
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