testutil

package
v0.1.23 Latest Latest
Warning

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

Go to latest
Published: May 26, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithRollbackTx

func WithRollbackTx(t *testing.T, tdb *TestDB, fn func(ctx context.Context))

Types

type Clock

type Clock interface {
	Now() time.Time
}

type FakeClock

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

func NewFakeClock

func NewFakeClock(start time.Time) *FakeClock

func (*FakeClock) Advance

func (f *FakeClock) Advance(d time.Duration)

func (*FakeClock) Now

func (f *FakeClock) Now() time.Time

func (*FakeClock) Set

func (f *FakeClock) Set(t time.Time)

type RealClock

type RealClock struct{}

func (RealClock) Now

func (RealClock) Now() time.Time

type TestDB

type TestDB struct {
	Store *store.Store
	Tx    *tx.Manager
}

func OpenTestDB

func OpenTestDB(t *testing.T) *TestDB

Jump to

Keyboard shortcuts

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