package clock
import "k8s.io/apimachinery/pkg/util/clock"
Index ¶
- func NewFakeClock(t time.Time) *testclocks.FakeClock
- func NewFakePassiveClock(t time.Time) *testclocks.FakePassiveClock
- type Clock
- type FakeClock
- type FakePassiveClock
- type IntervalClock
- type PassiveClock
- type RealClock
- type Ticker
- type Timer
Functions ¶
func NewFakeClock ¶
func NewFakeClock(t time.Time) *testclocks.FakeClock
NewFakeClock returns a new FakeClock.
Deprecated: Use k8s.io/utils/clock/testing.NewFakeClock instead.
func NewFakePassiveClock ¶
func NewFakePassiveClock(t time.Time) *testclocks.FakePassiveClock
NewFakePassiveClock returns a new FakePassiveClock.
Deprecated: Use k8s.io/utils/clock/testing.NewFakePassiveClock instead.
Types ¶
type Clock ¶
type Clock = clocks.WithTickerAndDelayedExecution
Clock allows for injecting fake or real clocks into code that needs to do arbitrary things based on time.
Deprecated: Use k8s.io/utils/clock.WithTickerAndDelayedExecution instead.
type FakeClock ¶
type FakeClock = testclocks.FakeClock
FakeClock implements Clock, but returns an arbitrary time.
Deprecated: Use k8s.io/utils/clock/testing.FakeClock instead.
type FakePassiveClock ¶
type FakePassiveClock = testclocks.FakePassiveClock
FakePassiveClock implements PassiveClock, but returns an arbitrary time.
Deprecated: Use k8s.io/utils/clock/testing.FakePassiveClock instead.
type IntervalClock ¶
type IntervalClock = testclocks.IntervalClock
IntervalClock implements Clock, but each invocation of Now steps the clock forward the specified duration.
WARNING: most of the Clock methods just `panic`; only PassiveClock is honestly implemented. The alternative, SimpleIntervalClock, has only the PassiveClock methods.
Deprecated: Use k8s.io/utils/clock/testing.SimpleIntervalClock instead.
type PassiveClock ¶
type PassiveClock = clocks.PassiveClock
PassiveClock allows for injecting fake or real clocks into code that needs to read the current time but does not support scheduling activity in the future.
Deprecated: Use k8s.io/utils/clock.PassiveClock instead.
type RealClock ¶
Deprecated: Use k8s.io/utils/clock.RealClock instead.
type Ticker ¶
Ticker defines the Ticker interface.
Deprecated: Use k8s.io/utils/clock.Ticker instead.
type Timer ¶
Timer allows for injecting fake or real timers into code that needs to do arbitrary things based on time.
Deprecated: Use k8s.io/utils/clock.Timer instead.
Source Files ¶
clock.go
- Version
- v0.24.13
- Published
- Feb 15, 2023
- Platform
- js/wasm
- Imports
- 3 packages
- Last checked
- 8 hours ago –
Tools for package owners.