seams

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2026 License: MIT Imports: 13 Imported by: 0 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

func DefaultRandom

func DefaultRandom() io.Reader

DefaultRandom returns crypto randomness or a deterministic reader when hooks are enabled.

Types

type BrowserOpener

type BrowserOpener func(url string) error

BrowserOpener opens a URL in the user's browser.

func DefaultBrowserOpener

func DefaultBrowserOpener() BrowserOpener

DefaultBrowserOpener returns the platform browser opener or a no-op opener when hooks are enabled.

type Clock

type Clock interface {
	Now() time.Time
}

Clock provides the current time.

func DefaultClock

func DefaultClock() Clock

DefaultClock returns the production clock or a frozen test clock when hooks are enabled.

type FixedClock

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

FixedClock is a concurrency-safe clock for tests.

func NewFixedClock

func NewFixedClock(t time.Time) *FixedClock

NewFixedClock returns a clock fixed at t.

func (*FixedClock) Advance

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

Advance moves the clock forward by d.

func (*FixedClock) Now

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

Now returns the clock's current fixed time.

func (*FixedClock) Set

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

Set changes the clock to t.

type HTTPDoer

type HTTPDoer interface {
	Do(*http.Request) (*http.Response, error)
}

HTTPDoer executes HTTP requests.

func DefaultHTTPDoer

func DefaultHTTPDoer() HTTPDoer

DefaultHTTPDoer returns the production HTTP client.

type ListenerFactory

type ListenerFactory func(addr string) (net.Listener, error)

ListenerFactory creates a network listener bound to an address.

func DefaultListener

func DefaultListener() ListenerFactory

DefaultListener returns the production TCP listener factory.

type Sleeper

type Sleeper interface {
	Sleep(time.Duration)
}

Sleeper pauses execution for a duration.

func DefaultSleeper

func DefaultSleeper() Sleeper

DefaultSleeper returns the production sleeper or a no-op sleeper when hooks are enabled.

Jump to

Keyboard shortcuts

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