pgmocktime

package
v0.33.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

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() error

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

Jump to

Keyboard shortcuts

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