util

package
v0.0.0-...-1b8c519 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2015 License: MIT Imports: 1 Imported by: 0

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
}

func NewClock

func NewClock() Clock

type Semaphore

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

func NewSemaphore

func NewSemaphore(capacity int) *Semaphore

func (*Semaphore) Capacity

func (s *Semaphore) Capacity() int

func (*Semaphore) Release

func (s *Semaphore) Release()

func (*Semaphore) TryAcquire

func (s *Semaphore) TryAcquire() bool

type TestableClock

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

func NewTestableClock

func NewTestableClock(now time.Time) *TestableClock

func (*TestableClock) Add

func (c *TestableClock) Add(d time.Duration)

func (*TestableClock) Now

func (c *TestableClock) Now() time.Time

func (*TestableClock) SetTime

func (c *TestableClock) SetTime(t time.Time)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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