pgmocktime

package
v0.35.0 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2026 License: Apache-2.0 Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mocker

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

func New

func New(ctx context.Context, dbURL string) (*Mocker, error)

New creates a new Mocker capable of manipulating time in a postgres database.

func (*Mocker) AdvanceTime

func (m *Mocker) AdvanceTime(ctx context.Context, d time.Duration) error

AdvanceTime advances the time by the given duration.

func (*Mocker) Close

func (m *Mocker) Close()

Close closes the database connection.

func (*Mocker) Inject

func (m *Mocker) Inject(ctx context.Context) error

Inject instruments the database for the manipulation of time.

func (*Mocker) Remove

func (m *Mocker) Remove(ctx context.Context) error

Remove removes instrumentation from the database.

func (*Mocker) Reset

func (m *Mocker) Reset(ctx context.Context) error

Reset sets the time to the current real time and resumes the normal flow of time.

func (*Mocker) SetSpeed

func (m *Mocker) SetSpeed(ctx context.Context, speed float64) error

SetSpeed sets the speed of time, 1.0 is the normal flow of time.

func (*Mocker) SetTime

func (m *Mocker) SetTime(ctx context.Context, t time.Time) error

SetTime sets the database time to the given time.

Directories

Path Synopsis
cmd
pgmocktime command

Jump to

Keyboard shortcuts

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