buildtest

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Data

func Data(relpath string) ([]byte, error)

func DataAs

func DataAs(relpath string, obj interface{}) error

func PrettyJSON

func PrettyJSON(x interface{}) (string, error)

func WaitNop

func WaitNop()

A convenience for passing into WaitUntil

func YAMLToJSON

func YAMLToJSON(y []byte) ([]byte, error)

Types

type Wait

type Wait struct {
	sync.WaitGroup
}

This extends WaitGroup with a few useful methods to avoid tests having a failure mode of hanging.

func NewWait

func NewWait() *Wait

A convenience for creating a "wait" object.

func (*Wait) Add

func (w *Wait) Add(delta int)

Override Add so folks don't call it.

func (*Wait) In

func (w *Wait) In(d time.Duration)

This calls Done() after the specified duration.

func (*Wait) WaitUntil

func (w *Wait) WaitUntil(d time.Duration, onSuccess func(), onTimeout func())

This waits until Done() has been called or the specified duration has elapsed. If Done() is called, then onSuccess is called. If the duration elapses without Done() being called, then onTimeout is called.

Jump to

Keyboard shortcuts

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