timesync

package
v0.0.0-...-62b8dee Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2025 License: GPL-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RtcTimetoTime

func RtcTimetoTime(t unix.RTCTime) time.Time

func TimetoRtcTime

func TimetoRtcTime(t time.Time) unix.RTCTime

Types

type SyncMode

type SyncMode struct {
	Ntp             bool
	Http            bool
	Ordering        []string
	NtpUseFallback  bool
	HttpUseFallback bool
}

type TimeSync

type TimeSync struct {
	// contains filtered or unexported fields
}

func NewTimeSync

func NewTimeSync(opts *TimeSyncOptions) *TimeSync

func (*TimeSync) IsSyncSuccess

func (t *TimeSync) IsSyncSuccess() bool

func (*TimeSync) SetDhcpNtpAddresses

func (t *TimeSync) SetDhcpNtpAddresses(addresses []string)

func (*TimeSync) Start

func (t *TimeSync) Start()

func (*TimeSync) Sync

func (t *TimeSync) Sync() error

type TimeSyncOptions

type TimeSyncOptions struct {
	PreCheckFunc  func() (bool, error)
	Logger        *zerolog.Logger
	NetworkConfig *network.NetworkConfig
}

Jump to

Keyboard shortcuts

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