Versions in this module Expand all Collapse all v0 v0.17.0 Apr 30, 2024 v0.16.0 Nov 9, 2023 Changes in this version + const JAN_1970 + func Precision() int8 + type Header struct + LeapIndicator LeapIndicator + Mode Mode + OriginTimestamp Timestamp + Poll int8 + Precision int8 + ReceiveTimestamp Timestamp + ReferenceId [4]byte + ReferenceTimestamp Timestamp + RootDelay Short + RootDispersion Short + Stratum uint8 + TransmitTimestamp Timestamp + VersionNumber VersionNumber + func (h *Header) MarshalBinary() ([]byte, error) + func (h *Header) UnmarshalBinary(data []byte) error + type LeapIndicator byte + const LEAP_ADD + const LEAP_NONE + const LEAP_NOSYNC + const LEAP_SUB + func (i LeapIndicator) String() string + type Mode byte + const MODE_BROADCAST + const MODE_CLIENT + const MODE_CONTROL + const MODE_PRIVATE + const MODE_RESERVED + const MODE_SERVER + const MODE_SYMMETRIC_ACTIVE + const MODE_SYMMETRIC_PASSIVE + func (i Mode) String() string + type Server struct + func NewServer(addr string) (*Server, error) + func (s *Server) Accept() (*ServerReq, error) + func (s *Server) Respond(r *ServerReq) + func (s *Server) Serve() + func (s *Server) SetLeapSecond(second time.Time, direction LeapIndicator) + func (s *Server) SetTime(now time.Time) + func (s *Server) UpdateOffset(now time.Time) (time.Duration, LeapIndicator) + type ServerReq struct + Client net.Addr + Packet []byte + Received time.Time + type Short struct + Fraction uint16 + Seconds uint16 + type Timestamp struct + Fraction uint32 + Seconds uint32 + func NewTimestamp(t time.Time) Timestamp + func Now() Timestamp + type VersionNumber byte + const NTPv4 + func (i VersionNumber) String() string