ntp

package
v1.10.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 25, 2024 License: LGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CurrentTime

func CurrentTime(ntpServer string) time.Time

CurrentTime return the current time calibrated using ntp server

Types

type ClockStatus added in v1.10.3

type ClockStatus int
const (
	ClockIsAccurate ClockStatus = iota
	ClockIsNotAccurate
	ClockInWarningRange
	AllNtpServersTimedOut
	NtpServersFailed
)

func CheckLocalTimeAccurate

func CheckLocalTimeAccurate(ntpServers string) (ClockStatus, error)

CheckLocalTimeAccurate returns whether the local clock accurate or not

func (ClockStatus) AllNtpServersTimedOut added in v1.10.3

func (s ClockStatus) AllNtpServersTimedOut() bool

func (ClockStatus) IsAccurate added in v1.10.3

func (s ClockStatus) IsAccurate() bool

func (ClockStatus) IsInWarningRange added in v1.10.3

func (s ClockStatus) IsInWarningRange() bool

func (ClockStatus) Message added in v1.10.3

func (s ClockStatus) Message() string

func (ClockStatus) NtpFailed added in v1.10.3

func (s ClockStatus) NtpFailed() bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL