Versions in this module Expand all Collapse all v1 v1.3.1 Aug 26, 2026 v1.3.0 Aug 23, 2026 v1.2.1 Aug 21, 2026 v1.2.0 Aug 11, 2026 Changes in this version + const LeapAddSecond + const LeapDelSecond + const LeapNoWarning + const LeapNotInSync + 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") + func ClockOffsetChan(ctx context.Context, interval time.Duration, hosts ...string) chan time.Duration + func Time(address string) (time.Time, error) + func TimeChan(ctx context.Context, interval time.Duration, hosts ...string) chan time.Time + type AuthOptions struct + Key string + KeyID uint16 + Type AuthType + type AuthType int + const AuthAES128 + const AuthAES256 + 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 HostResponse struct + Host string + Resp *Response + func HostPreferred(hosts []string) *HostResponse + type LeapIndicator uint8 + type QueryOptions struct + Auth AuthOptions + Dial func(laddr string, lport int, raddr string, rport int) (net.Conn, error) + Dialer func(localAddress, remoteAddress string) (net.Conn, error) + Extensions []Extension + 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 + Version int + func GetResponse(host string) *Response + func Query(address string) (*Response, error) + func QueryWithOptions(address string, opt QueryOptions) (*Response, error) + func (r *Response) IsKissOfDeath() bool + func (r *Response) ReferenceString() string + func (r *Response) Validate() error