Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Checker ¶
type Checker struct {
// contains filtered or unexported fields
}
Checker represents a NTP checker that periodically checks the system time against the network time.
func NewNtpChecker ¶
func NewNtpChecker(opts ...CheckerOption) *Checker
NewNtpChecker creates a new Checker with the provided options. If no options are provided, it uses default values for interval and threshold.
func (*Checker) ClockOffset ¶ added in v1.3.0
func (*Checker) IsOutOfSync ¶ added in v1.3.0
type CheckerOption ¶ added in v1.3.0
type CheckerOption func(*Checker)
CheckerOption defines the type for functions that configure a Checker.
func WithInterval ¶ added in v1.3.0
func WithInterval(interval time.Duration) CheckerOption
WithInterval sets the interval at which the checker will run. Default interval is 1 minute.
func WithQuerier ¶ added in v1.3.0
func WithQuerier(querier Querier) CheckerOption
WithQuerier sets the Querier for the Checker.
func WithThreshold ¶ added in v1.3.0
func WithThreshold(threshold time.Duration) CheckerOption
WithThreshold sets the threshold for determining if the system time is out of sync. Default threshold is 1 second.
type QueryError ¶ added in v1.3.0
type QueryError struct{}
QueryError is returned when a query from all NTP pools encounters an error and we have no valid response from them.
func (QueryError) Error ¶ added in v1.3.0
func (QueryError) Error() string
type RemoteQuerier ¶ added in v1.3.0
type RemoteQuerier struct{}