timeprovider

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Now

func Now() *metav1.Time

func TimeoutReached

func TimeoutReached(previous, current *metav1.Time, timeout time.Duration) bool

Types

type Provider

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

The purpose if the Provider is to have a non-moving resp. fakable now for testing.

func New

func New() *Provider

New time provider always returns the current time

func (*Provider) Freeze

func (timeProvider *Provider) Freeze() *Provider

func (*Provider) IsOutdated

func (timeProvider *Provider) IsOutdated(previous *metav1.Time, timeout time.Duration) bool

func (*Provider) Now

func (timeProvider *Provider) Now() *metav1.Time

func (*Provider) Set

func (timeProvider *Provider) Set(now *metav1.Time)

Jump to

Keyboard shortcuts

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