Versions in this module Expand all Collapse all v1 v1.3.0 Sep 16, 2021 v1.2.0 Oct 22, 2020 v1.0.1 Oct 10, 2020 Changes in this version + const LeapAddSecond + const LeapDelSecond + const LeapNoWarning + const LeapNotInSync + const NtpHost + const NtpHost1 + const NtpHost2 + const NtpHost3 + const NtpHost4 + const NtpHost5 + const NtpHost6 + func CheckLocalTimeIsNtp() error + func SetNtpToLocal(ntpTimeStamp int64) error + func Time(host string) (time.Time, error) + func TimeV(host string, version int) (time.Time, error) + type Clock interface + After func(d time.Duration) <-chan time.Time + AfterFunc func(d time.Duration, f func()) *Timer + Now func() time.Time + Since func(t time.Time) time.Duration + Sleep func(d time.Duration) + Tick func(d time.Duration) <-chan time.Time + Ticker func(d time.Duration) *Ticker + Timer func(d time.Duration) *Timer + func New() Clock + type LeapIndicator uint8 + type Mock struct + func NewMock() *Mock + func NewNtpClock() (*Mock, error) + func (m *Mock) Add(d time.Duration) + func (m *Mock) After(d time.Duration) <-chan time.Time + func (m *Mock) AfterFunc(d time.Duration, f func()) *Timer + func (m *Mock) Now() time.Time + func (m *Mock) Set(t time.Time) + func (m *Mock) Since(t time.Time) time.Duration + func (m *Mock) Sleep(d time.Duration) + func (m *Mock) Tick(d time.Duration) <-chan time.Time + func (m *Mock) Ticker(d time.Duration) *Ticker + func (m *Mock) Timer(d time.Duration) *Timer + type QueryOptions struct + LocalAddress string + Port int + TTL int + Timeout time.Duration + Version int + type Response struct + ClockOffset time.Duration + KissCode string + Leap LeapIndicator + MinError time.Duration + Poll time.Duration + Precision time.Duration + RTT time.Duration + ReferenceID uint32 + ReferenceTime time.Time + RootDelay time.Duration + RootDispersion time.Duration + RootDistance time.Duration + Stratum uint8 + Time time.Time + func Query(host string) (*Response, error) + func QueryWithOptions(host string, opt QueryOptions) (*Response, error) + func (r *Response) Validate() error + type Ticker struct + C <-chan time.Time + func (t *Ticker) Stop() + type Timer struct + C <-chan time.Time + func (t *Timer) Reset(d time.Duration) bool + func (t *Timer) Stop() bool