Documentation
¶
Index ¶
- Variables
- func IsTimeSetAndEarlier(ts *metav1.Time) bool
- func IsTimeSetAndEarlierOrEqual(ts *metav1.Time) bool
- func IsTimeSetAndEarlierThan(ts *metav1.Time, other time.Time) bool
- func IsTimeSetAndEarlierThanOrEqualTo(ts *metav1.Time, other time.Time) bool
- func IsTimeSetAndLater(ts *metav1.Time) bool
- func IsTimeSetAndLaterThan(ts *metav1.Time, other time.Time) bool
- func IsTimeSetAndLaterThanOrEqualTo(ts *metav1.Time, other time.Time) bool
- func IsUnixZero(ts *metav1.Time) bool
- func Now() *metav1.Time
- func TimeMax(ts1, ts2 *metav1.Time) *metav1.Time
- func UnwrapMetaV1Time(ts *metav1.Time) time.Time
Constants ¶
This section is empty.
Variables ¶
var ( // Clock is used to mock time.Now() for tests. // Use Clock.Now() instead of time.Now() whenever needed. Clock clock.PassiveClock = clock.RealClock{} )
Functions ¶
func IsTimeSetAndEarlier ¶
IsTimeSetAndEarlier returns true if the given *metav1.Time is set and earlier than the current time. Useful to validate timestamp updates which cannot be extended.
func IsTimeSetAndEarlierOrEqual ¶ added in v0.2.0
IsTimeSetAndEarlierOrEqual returns true if the given *metav1.Time is set and earlier than or equal to the current time. Useful to validate timestamp updates which cannot be extended.
func IsTimeSetAndEarlierThan ¶
IsTimeSetAndEarlierThan returns true if the given *metav1.Time is set and earlier than the other time.Time. Useful to validate timestamp updates which cannot be extended.
func IsTimeSetAndEarlierThanOrEqualTo ¶
IsTimeSetAndEarlierThanOrEqualTo returns true if the given *metav1.Time is set and earlier than or equal to the other time.Time. Useful to validate timestamp updates which cannot be extended.
func IsTimeSetAndLater ¶
IsTimeSetAndLater returns true if the given *metav1.Time is set and later than the current time. Useful to validate timestamp updates which cannot be extended.
func IsTimeSetAndLaterThan ¶
IsTimeSetAndLaterThan returns true if the given *metav1.Time is set and later than the other time.Time. Useful to validate timestamp updates which cannot be extended.
func IsTimeSetAndLaterThanOrEqualTo ¶
IsTimeSetAndLaterThanOrEqualTo returns true if the given *metav1.Time is set and later than or equal to the other time.Time. Useful to validate timestamp updates which cannot be extended.
func IsUnixZero ¶
IsUnixZero provides a more robust check for whether a metav1.Time is truly a zero time, by also checking if it is equivalent to the epoch (i.e. Unix() returns 0).
Types ¶
This section is empty.