time

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package time provides time-related resources.

Index

Constants

View Source
const AdjtimeStatusID = resource.ID("node")

AdjtimeStatusID is the ID of the singletone resource.

View Source
const AdjtimeStatusType = resource.Type("AdjtimeStatuses.v1alpha1.talos.dev")

AdjtimeStatusType is type of AdjtimeStatus resource.

View Source
const StatusID = resource.ID("node")

StatusID is the ID of the singletone resource.

View Source
const StatusType = resource.Type("TimeStatuses.v1alpha1.talos.dev")

StatusType is type of TimeSync resource.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdjtimeStatus added in v1.6.0

AdjtimeStatus describes running current time sync AdjtimeStatus.

func NewAdjtimeStatus added in v1.6.0

func NewAdjtimeStatus() *AdjtimeStatus

NewAdjtimeStatus initializes a TimeSync resource.

type AdjtimeStatusExtension added in v1.6.0

type AdjtimeStatusExtension struct{}

AdjtimeStatusExtension provides auxiliary methods for AdjtimeStatus.

func (AdjtimeStatusExtension) ResourceDefinition added in v1.6.0

func (AdjtimeStatusExtension) ResourceDefinition() meta.ResourceDefinitionSpec

ResourceDefinition implements meta.ResourceDefinitionProvider interface.

type AdjtimeStatusSpec added in v1.6.0

type AdjtimeStatusSpec struct {
	Offset                   time.Duration `yaml:"offset" protobuf:"1"`
	FrequencyAdjustmentRatio float64       `yaml:"frequencyAdjustmentRatio" protobuf:"2"`
	MaxError                 time.Duration `yaml:"maxError" protobuf:"3"`
	EstError                 time.Duration `yaml:"estError" protobuf:"4"`
	Status                   string        `yaml:"status" protobuf:"5"`
	Constant                 int           `yaml:"constant" protobuf:"6"`
	SyncStatus               bool          `yaml:"syncStatus" protobuf:"7"`
	State                    string        `yaml:"state" protobuf:"8"`
}

AdjtimeStatusSpec describes Linux internal adjtime state.

func (AdjtimeStatusSpec) DeepCopy added in v1.6.0

func (o AdjtimeStatusSpec) DeepCopy() AdjtimeStatusSpec

DeepCopy generates a deep copy of AdjtimeStatusSpec.

type Status

Status describes running current time sync status.

func NewStatus

func NewStatus() *Status

NewStatus initializes a TimeSync resource.

type StatusExtension added in v1.4.0

type StatusExtension struct{}

StatusExtension provides auxiliary methods for Status.

func (StatusExtension) ResourceDefinition added in v1.4.0

func (StatusExtension) ResourceDefinition() meta.ResourceDefinitionSpec

ResourceDefinition implements meta.ResourceDefinitionProvider interface.

type StatusSpec

type StatusSpec struct {
	// Synced indicates whether time is in sync.
	Synced bool `yaml:"synced" protobuf:"1"`

	// Epoch is incremented every time clock jumps more than 15min.
	Epoch int `yaml:"epoch" protobuf:"2"`

	// SyncDisabled indicates if time sync is disabled.
	SyncDisabled bool `yaml:"syncDisabled" protobuf:"3"`
}

StatusSpec describes time sync state.

func (StatusSpec) DeepCopy

func (o StatusSpec) DeepCopy() StatusSpec

DeepCopy generates a deep copy of StatusSpec.

type SyncCondition

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

SyncCondition implements condition which waits for the time to be in sync.

func NewSyncCondition

func NewSyncCondition(state state.State) *SyncCondition

NewSyncCondition builds a coondition which waits for the time to be in sync.

func (*SyncCondition) String

func (condition *SyncCondition) String() string

func (*SyncCondition) Wait

func (condition *SyncCondition) Wait(ctx context.Context) error

Wait implements condition interface.

Jump to

Keyboard shortcuts

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