Skip to content
Snippets Groups Projects
Commit 02d4ef34 authored by Josh Brooks's avatar Josh Brooks
Browse files

Add netTime functionality to bindings

parent 18921753
No related branches found
No related tags found
4 merge requests!510Release,!419rewrote the health tracker to both consider if there are waiting rounds and...,!405Add netTime functionality to bindings,!340Project/channels
///////////////////////////////////////////////////////////////////////////////
// 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/netTime"
"time"
)
// SetTimeSource will set the time source that will be used when retrieving the
// current time using [netTime.Now].
//
// Parameters:
// - timeNow is an object which adheres to [netTime.TimeSource]. Specifically,
// this object should a NowMs() method which return a 64-bit integer value.
func SetTimeSource(timeNow netTime.TimeSource) {
netTime.SetTimeSource(timeNow)
}
// SetOffset will set an internal offset variable. All calls to [netTime.Now]
// will have this offset applied to this value.
//
// Parameters:
// - offset is a time by which netTime.Now will be offset. This value may be
// negative or positive. This expects a 64-bit integer value which will
// represent the number in microseconds this offset will be.
func SetOffset(offset int64) {
netTime.SetOffset(time.Duration(offset) * time.Microsecond)
}
......@@ -18,7 +18,7 @@ require (
gitlab.com/elixxir/primitives v0.0.3-0.20220606195757-40f7a589347f
gitlab.com/xx_network/comms v0.0.4-0.20220630163702-f3d372ef6acd
gitlab.com/xx_network/crypto v0.0.5-0.20220729193517-1e5e96f39f6e
gitlab.com/xx_network/primitives v0.0.4-0.20220712193914-aebd8544396e
gitlab.com/xx_network/primitives v0.0.4-0.20221010192422-3479f09b7769
go.uber.org/ratelimit v0.2.0
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa
golang.org/x/net v0.0.0-20220802222814-0bcc04d9c69b
......
......@@ -461,6 +461,8 @@ gitlab.com/xx_network/primitives v0.0.4-0.20220324193139-b292d1ae6e7e/go.mod h1:
gitlab.com/xx_network/primitives v0.0.4-0.20220630163313-7890038258c6/go.mod h1:AXVVFt7dDAeIUpOGPiStCcUIKsBXLWbmV/BgZ4T+tOo=
gitlab.com/xx_network/primitives v0.0.4-0.20220712193914-aebd8544396e h1:zRRo/v3KUo3MtpjNJaB03LR+Zi2g1afYF8yKWl1t19o=
gitlab.com/xx_network/primitives v0.0.4-0.20220712193914-aebd8544396e/go.mod h1:AXVVFt7dDAeIUpOGPiStCcUIKsBXLWbmV/BgZ4T+tOo=
gitlab.com/xx_network/primitives v0.0.4-0.20221010192422-3479f09b7769 h1:BBYSog3VSKudey4rhWnCw54PcGcD4YRjTrnwzOhJ/GE=
gitlab.com/xx_network/primitives v0.0.4-0.20221010192422-3479f09b7769/go.mod h1:AXVVFt7dDAeIUpOGPiStCcUIKsBXLWbmV/BgZ4T+tOo=
gitlab.com/xx_network/ring v0.0.3-0.20220222211904-da613960ad93 h1:eJZrXqHsMmmejEPWw8gNAt0I8CGAMNO/7C339Zco3TM=
gitlab.com/xx_network/ring v0.0.3-0.20220222211904-da613960ad93/go.mod h1:aLzpP2TiZTQut/PVHR40EJAomzugDdHXetbieRClXIM=
go.etcd.io/etcd/api/v3 v3.5.4/go.mod h1:5GB2vv4A4AOn3yk7MftYGHkUfGtDHnEraIjym4dYz5A=
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment