faketime

package
v0.35.13 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: Unlicense Imports: 2 Imported by: 0

Documentation

Overview

Package faketime contains fake implementations of interfaces from package timeutil.

It is recommended to fill all methods that shouldn't be called with:

panic(testutil.UnexpectedCall(arg1, arg2))

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Clock

type Clock struct {
	OnNow func() (now time.Time)
}

Clock is the timeutil.Clock implementation for tests.

func (*Clock) Now

func (c *Clock) Now() (now time.Time)

Now implements the timeutil.Clock interface for *Clock.

type Schedule

type Schedule struct {
	OnUntilNext func(now time.Time) (d time.Duration)
}

Schedule is the timeutil.Schedule implementation for tests.

func (*Schedule) UntilNext

func (s *Schedule) UntilNext(now time.Time) (d time.Duration)

UntilNext implements the timeutil.Schedule interface for *Schedule.

Jump to

Keyboard shortcuts

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