Documentation ¶
Index ¶
Constants ¶
View Source
const ( // MaxAllowablePoll is the 'recommended' interval for querying a time server. MaxAllowablePoll = 1024 // MinAllowablePoll is the minimum time allowed for a client to query a time server. MinAllowablePoll = 4 // AdjustTimeLimit is a maximum time drift to compensate via adjtimex(). AdjustTimeLimit = 128 * time.Millisecond )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NTP ¶
type NTP struct { Server string MinPoll time.Duration MaxPoll time.Duration // contains filtered or unexported fields }
NTP contains a server address.
func NewNTPClient ¶
NewNTPClient instantiates a new ntp client for the specified server.
func (*NTP) Daemon ¶
Daemon runs the control loop for query and set time We dont ever want the daemon to stop, so we only log errors.
func (*NTP) QueryAndSetTime ¶
QueryAndSetTime queries the NTP server and sets the time.
type Option ¶
Option allows for the configuration of the ntp client.
func WithMaxPoll ¶
WithMaxPoll configures the ntp client MaxPoll interval.
func WithMinPoll ¶
WithMinPoll configures the ntp client MinPoll interval.
func WithServer ¶
WithServer configures the ntp client to use the specified server.
Click to show internal directories.
Click to hide internal directories.