clock

package
v0.0.54 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2015 License: Apache-2.0, Apache-2.0 Imports: 1 Imported by: 0

README

Provides a Clock interface, useful for injecting time dependencies in tests.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Clock

type Clock interface {
	Now() time.Time
	Sleep(d time.Duration)

	NewTimer(d time.Duration) Timer
	NewTicker(d time.Duration) Ticker
}

func NewClock

func NewClock() Clock

type Ticker

type Ticker interface {
	C() <-chan time.Time
	Stop()
}

type Timer

type Timer interface {
	C() <-chan time.Time
	Reset(d time.Duration) bool
	Stop() bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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