test_helpers

package
v0.0.0-...-6e5da2a Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2016 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NoReadyExitedNormally = errors.New("no ready exited normally")
View Source
var NoReadyRunner = ifrit.RunFunc(func(sigChan <-chan os.Signal, ready chan<- struct{}) error {
	return NoReadyExitedNormally
})

NoReadyRunner exits without closing the ready chan

View Source
var PingerExitedFromPing = errors.New("pinger exited with a ping")
View Source
var PingerExitedFromSignal = errors.New("pinger exited with a signal")

Functions

This section is empty.

Types

type Ping

type Ping struct{}

type PingChan

type PingChan chan Ping

PingChan stops when you send it a single Ping

func (PingChan) Load

func (p PingChan) Load(err error) (ifrit.Runner, bool)

func (PingChan) Run

func (p PingChan) Run(sigChan <-chan os.Signal, ready chan<- struct{}) error

type SignalRecoder

type SignalRecoder struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

SignalRecoder records all signals received, and exits on a set of signals.

func NewSignalRecorder

func NewSignalRecorder(exitSignals ...os.Signal) *SignalRecoder

func (*SignalRecoder) Load

func (r *SignalRecoder) Load(err error) (ifrit.Runner, bool)

func (*SignalRecoder) ReceivedSignals

func (r *SignalRecoder) ReceivedSignals() []os.Signal

func (*SignalRecoder) Run

func (r *SignalRecoder) Run(sigChan <-chan os.Signal, ready chan<- struct{}) error

Jump to

Keyboard shortcuts

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