Versions in this module Expand all Collapse all v1 v1.4.3 May 30, 2024 v1.4.2 May 23, 2024 v1.4.1 May 3, 2024 v1.4.0 May 2, 2024 Changes in this version type Response + Version int v1.3.1 Dec 24, 2023 Changes in this version type AuthType + const AuthAES256 v1.3.0 Jul 29, 2023 Changes in this version type Response + func (r *Response) ReferenceString() string v1.2.0 Jul 13, 2023 Changes in this version + var ErrAuthFailed = errors.New("authentication failed") + var ErrInvalidAuthKey = errors.New("invalid authentication key") + var ErrInvalidDispersion = errors.New("invalid dispersion in response") + var ErrInvalidLeapSecond = errors.New("invalid leap second in response") + var ErrInvalidMode = errors.New("invalid mode in response") + var ErrInvalidProtocolVersion = errors.New("invalid protocol version requested") + var ErrInvalidStratum = errors.New("invalid stratum in response") + var ErrInvalidTime = errors.New("invalid time reported") + var ErrInvalidTransmitTime = errors.New("invalid transmit time in response") + var ErrKissOfDeath = errors.New("kiss of death received") + var ErrServerClockFreshness = errors.New("server clock not fresh") + var ErrServerResponseMismatch = errors.New("server response didn't match request") + var ErrServerTickedBackwards = errors.New("server clock ticked backwards") + type AuthOptions struct + Key string + KeyID uint16 + Type AuthType + type AuthType int + const AuthAES128 + const AuthMD5 + const AuthNone + const AuthSHA1 + const AuthSHA256 + const AuthSHA512 + type Extension interface + ProcessQuery func(buf *bytes.Buffer) error + ProcessResponse func(buf []byte) error type QueryOptions + Auth AuthOptions + Dialer func(localAddress, remoteAddress string) (net.Conn, error) + Extensions []Extension type Response + func (r *Response) IsKissOfDeath() bool v1.1.1 Jun 13, 2023 v1.1.0 Jun 13, 2023 Changes in this version type QueryOptions + Dial dialFn v1.1.0-beta.1 Jun 13, 2023 v1.0.0 May 7, 2023 v0 v0.3.3 May 4, 2023 v0.3.2 May 2, 2023 v0.3.1 May 2, 2023 v0.3.0 Mar 19, 2020 v0.2.0 Oct 20, 2017 Changes in this version type Response + KissCode string v0.1.1 Oct 3, 2017 v0.1.0 Sep 30, 2017 Changes in this version + const LeapAddSecond + const LeapDelSecond + const LeapNoWarning + const LeapNotInSync + const MaxStratum + func Time(host string) (time.Time, error) + func TimeV(host string, version int) (time.Time, error) + type LeapIndicator uint8 + type QueryOptions struct + LocalAddress string + Port int + TTL int + Timeout time.Duration + Version int + type Response struct + ClockOffset time.Duration + 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