Versions in this module Expand all Collapse all v0 v0.0.1 May 15, 2020 Changes in this version + const DefaultNtpPort + const MaxAllowedMessageDrift + const MaxRequestTries + const MinResultsThreshold + const NtpOffset + const RequestTriesInterval + var DefaultServers = []string + func CheckMessageDrift(data int64) bool + func CheckSystemClockDrift() (time.Duration, error) + type Clock interface + Now func() time.Time + type LayerConv struct + func (lc LayerConv) LayerToTime(id types.LayerID) time.Time + func (lc LayerConv) TimeToLayer(t time.Time) types.LayerID + type LayerConverter interface + LayerToTime func(types.LayerID) time.Time + TimeToLayer func(time.Time) types.LayerID + type LayerTimer chan types.LayerID + type NtpPacket struct + OrigTimeFrac uint32 + OrigTimeSec uint32 + Poll int8 + Precision int8 + RefTimeFrac uint32 + RefTimeSec uint32 + ReferenceID uint32 + RootDelay uint32 + RootDispersion uint32 + RxTimeFrac uint32 + RxTimeSec uint32 + Settings uint8 + Stratum uint8 + TxTimeFrac uint32 + TxTimeSec uint32 + func (n *NtpPacket) Time() time.Time + type RealClock struct + func (RealClock) Now() time.Time + type Ticker struct + func NewTicker(c Clock, lc LayerConverter) *Ticker + func (s Ticker) Subscribe() LayerTimer + func (s Ticker) Unsubscribe(ch LayerTimer) + func (t *Ticker) AwaitLayer(layerID types.LayerID) chan struct{} + func (t *Ticker) GetCurrentLayer() types.LayerID + func (t *Ticker) Notify() (int, error) + func (t *Ticker) StartNotifying() + type TimeClock struct + func NewClock(c Clock, tickInterval time.Duration, genesisTime time.Time, logger log.Log) *TimeClock + func (s TimeClock) Subscribe() LayerTimer + func (s TimeClock) Unsubscribe(ch LayerTimer) + func (t *TimeClock) Close() + func (t *TimeClock) GetGenesisTime() time.Time + func (t *TimeClock) GetInterval() time.Duration