time

package
v0.5.7 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2024 License: MPL-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package time contains controllers managing time, synchronization, etc.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdjtimeStatusController

type AdjtimeStatusController struct {
	V1Alpha1Mode v1alpha1runtime.Mode
}

AdjtimeStatusController manages time.AdjtimeStatus based on Linux kernel info.

func (*AdjtimeStatusController) Inputs

func (ctrl *AdjtimeStatusController) Inputs() []controller.Input

Inputs implements controller.Controller interface.

func (*AdjtimeStatusController) Name

func (ctrl *AdjtimeStatusController) Name() string

Name implements controller.Controller interface.

func (*AdjtimeStatusController) Outputs

func (ctrl *AdjtimeStatusController) Outputs() []controller.Output

Outputs implements controller.Controller interface.

func (*AdjtimeStatusController) Run

Run implements controller.Controller interface.

type NTPSyncer

type NTPSyncer interface {
	Run(ctx context.Context)
	Synced() <-chan struct{}
	EpochChange() <-chan struct{}
	SetTimeServers([]string)
}

NTPSyncer interface is implemented by ntp.Syncer, interface for mocking.

type NewNTPSyncerFunc

type NewNTPSyncerFunc func(*zap.Logger, []string) NTPSyncer

NewNTPSyncerFunc function allows to replace ntp.Syncer with the mock.

type SyncController

type SyncController struct {
	V1Alpha1Mode v1alpha1runtime.Mode
	NewNTPSyncer NewNTPSyncerFunc
	// contains filtered or unexported fields
}

SyncController manages v1alpha1.TimeSync based on configuration and NTP sync process.

func (*SyncController) Inputs

func (ctrl *SyncController) Inputs() []controller.Input

Inputs implements controller.Controller interface.

func (*SyncController) Name

func (ctrl *SyncController) Name() string

Name implements controller.Controller interface.

func (*SyncController) Outputs

func (ctrl *SyncController) Outputs() []controller.Output

Outputs implements controller.Controller interface.

func (*SyncController) Run

func (ctrl *SyncController) Run(ctx context.Context, r controller.Runtime, logger *zap.Logger) error

Run implements controller.Controller interface.

Jump to

Keyboard shortcuts

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