testtime

package
v0.0.0-...-9bdbb14 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FrozenTime

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

FrozenTime is a type for testing out fake times.

func NewFrozenTime

func NewFrozenTime(t time.Time) *FrozenTime

NewFrozenTime returns a FrozenTime for a given time.Time.

func NewFrozenTimeUnix

func NewFrozenTimeUnix(unix int64) *FrozenTime

NewFrozenTime returns a FrozenTime for a given unix second.

func (*FrozenTime) After

func (f *FrozenTime) After(d time.Duration) time.Time

After returns a time after FrozenTime.Now() by a given duration.

func (*FrozenTime) AfterFunc

func (f *FrozenTime) AfterFunc(d time.Duration) TimeFunc

AfterFunc returns a TimeFunc where the return value is a time after FrozenTime.Now() by a given duration.

func (*FrozenTime) AfterSec

func (f *FrozenTime) AfterSec(s int64) time.Time

After Now() by int64 seconds.

func (*FrozenTime) Before

func (f *FrozenTime) Before(d time.Duration) time.Time

Before returns a time before FrozenTime.Now() by a given duration.

func (*FrozenTime) BeforeFunc

func (f *FrozenTime) BeforeFunc(d time.Duration) TimeFunc

BeforeFunc returns a TimeFunc where the return value is a time before FrozenTime.Now() by a given duration.

func (*FrozenTime) BeforeSec

func (f *FrozenTime) BeforeSec(s int64) time.Time

Before Now() by int64 seconds.

func (*FrozenTime) MetaV1After

func (f *FrozenTime) MetaV1After(d time.Duration) *metav1.Time

func (*FrozenTime) MetaV1AfterFunc

func (f *FrozenTime) MetaV1AfterFunc(d time.Duration) MetaV1TimeFunc

func (*FrozenTime) MetaV1AfterSec

func (f *FrozenTime) MetaV1AfterSec(s int64) *metav1.Time

func (*FrozenTime) MetaV1Before

func (f *FrozenTime) MetaV1Before(d time.Duration) *metav1.Time

func (*FrozenTime) MetaV1BeforeFunc

func (f *FrozenTime) MetaV1BeforeFunc(d time.Duration) MetaV1TimeFunc

func (*FrozenTime) MetaV1BeforeSec

func (f *FrozenTime) MetaV1BeforeSec(s int64) *metav1.Time

func (*FrozenTime) MetaV1Now

func (f *FrozenTime) MetaV1Now() *metav1.Time

func (*FrozenTime) Now

func (f *FrozenTime) Now() time.Time

Now never changes.

func (*FrozenTime) PbAfter

func (f *FrozenTime) PbAfter(d time.Duration) *timestamppb.Timestamp

func (*FrozenTime) PbAfterFunc

func (f *FrozenTime) PbAfterFunc(d time.Duration) ProtobufTimeFunc

func (*FrozenTime) PbAfterSec

func (f *FrozenTime) PbAfterSec(s int64) *timestamppb.Timestamp

func (*FrozenTime) PbBefore

func (f *FrozenTime) PbBefore(d time.Duration) *timestamppb.Timestamp

func (*FrozenTime) PbBeforeFunc

func (f *FrozenTime) PbBeforeFunc(d time.Duration) ProtobufTimeFunc

func (*FrozenTime) PbBeforeSec

func (f *FrozenTime) PbBeforeSec(s int64) *timestamppb.Timestamp

func (*FrozenTime) PbNow

func (f *FrozenTime) PbNow() *timestamppb.Timestamp

type MetaV1TimeFunc

type MetaV1TimeFunc func() *metav1.Time

type ProtobufTimeFunc

type ProtobufTimeFunc func() *timestamppb.Timestamp

type TimeFunc

type TimeFunc func() time.Time

Jump to

Keyboard shortcuts

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