time

package
v1.3.0-beta.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2022 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package time provides time-related resources.

Index

Constants

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 Status

type Status = typed.Resource[StatusSpec, StatusRD]

Status describes running current time sync status.

func NewStatus

func NewStatus() *Status

NewStatus initializes a TimeSync resource.

type StatusRD

type StatusRD struct{}

StatusRD provides auxiliary methods for Status.

func (StatusRD) ResourceDefinition

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