Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClockManager ¶ added in v0.5.3
type ClockManager struct {
// contains filtered or unexported fields
}
func NewClockManager ¶ added in v0.5.3
func NewClockManager() *ClockManager
func (*ClockManager) ReadServer ¶ added in v0.5.3
func (this *ClockManager) ReadServer(server string) (time.Time, error)
ReadServer 参考自:https://medium.com/learning-the-go-programming-language/lets-make-an-ntp-client-in-go-287c4b9a969f
type NTPPacket ¶ added in v0.5.3
type NTPPacket struct { Settings uint8 // leap yr indicator, ver number, and mode Stratum uint8 // stratum of local clock Poll int8 // poll exponent Precision int8 // precision exponent RootDelay uint32 // root delay RootDispersion uint32 // root dispersion ReferenceID uint32 // reference id RefTimeSec uint32 // reference timestamp sec RefTimeFrac uint32 // reference timestamp fractional OrigTimeSec uint32 // origin time secs OrigTimeFrac uint32 // origin time fractional RxTimeSec uint32 // receive time secs RxTimeFrac uint32 // receive time frac TxTimeSec uint32 // transmit time secs TxTimeFrac uint32 // transmit time frac }
Click to show internal directories.
Click to hide internal directories.