timejump

package
v2.10.23 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	Enabled      bool   `long:"timejump-enabled" env:"TIMEJUMP_ENABLED" description:"Set true if you want timejumps to be enabled"`
	Namespace    string `` /* 145-byte string literal not displayed */
	ResourceName string `` /* 150-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*Options) Initialize

func (o *Options) Initialize(ctx context.Context, kubeOpts kube.KubernetesOptions)

func (*Options) Timejumper added in v2.10.14

func (o *Options) Timejumper() *Timejumper

Timejumper returns a Timejumper that writes to the ConfigMap configured by o. Options.Initialize must have been called beforehand, as it is used to obtain the kube client.

type Timejumper added in v2.10.14

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

Timejumper writes offsets to the timejump ConfigMap, causing every instance observing that ConfigMap (via Options.Initialize) to jump its mocked clock forward.

func (*Timejumper) CurrentOffset added in v2.10.16

func (j *Timejumper) CurrentOffset() time.Duration

CurrentOffset returns the offset currently applied to the mocked clock, i.e. how far clock.GlobalClock.Now() runs ahead of wall-clock time. It is zero when timejump is disabled or no jump has happened yet.

func (*Timejumper) JumpTo added in v2.10.14

func (j *Timejumper) JumpTo(ctx context.Context, t time.Time) error

JumpTo updates the timejump ConfigMap so that the mocked clock jumps to t. The offset is computed relative to time.Now(), so t must lie in the future. An error is returned if the resulting offset would be negative, i.e. if t is in the past.

Jump to

Keyboard shortcuts

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