clockdrift

package
v0.0.71 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2025 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClockDrift

type ClockDrift interface {
	// GetDrift returns the current clock drift.
	GetDrift() time.Duration
	// Now returns the current time adjusted for clock drift.
	Now() time.Time
}

ClockDrift is the interface that wraps the methods for the clock drift service.

type ClockDriftConfig

type ClockDriftConfig struct {
	// NTP server to use for syncing
	NTPServer string `yaml:"ntpServer" default:"pool.ntp.org"`
	// How often to sync clock drift
	SyncInterval time.Duration `yaml:"syncInterval" default:"5m"`
}

ClockDriftConfig is the configuration for the clock drift service.

type Service

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

Service is the clock drift service.

func NewService

func NewService(log logrus.FieldLogger, config *ClockDriftConfig) *Service

NewService creates a new clock drift service.

func (*Service) GetDrift

func (s *Service) GetDrift() time.Duration

GetDrift returns the current clock drift.

func (*Service) Now

func (s *Service) Now() time.Time

Now returns the current time adjusted for clock drift.

func (*Service) Start

func (s *Service) Start(_ context.Context) error

Start starts the clock drift service.

func (*Service) Stop

func (s *Service) Stop(_ context.Context) error

Stop stops the clock drift service.

Jump to

Keyboard shortcuts

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