Documentation ¶
Overview ¶
Package testutils contains testing helpers.
Index ¶
Constants ¶
View Source
const ( // DefaultChanRecvTimeout is the default timeout for receive operations on the // underlying channel. DefaultChanRecvTimeout = 1 * time.Second // DefaultChanBufferSize is the default buffer size of the underlying channel. DefaultChanBufferSize = 1 )
Variables ¶
View Source
var ErrRecvTimeout = errors.New("timed out when waiting for value on channel")
ErrRecvTimeout is an error to indicate that a receive operation on the channel timed out.
Functions ¶
func StatusErrEqual ¶ added in v1.22.0
StatusErrEqual returns true iff both err1 and err2 wrap status.Status errors and their underlying status protos are equal.
Types ¶
type Channel ¶ added in v1.30.0
type Channel struct {
// contains filtered or unexported fields
}
Channel wraps a generic channel and provides a timed receive operation.
func NewChannelWithSize ¶ added in v1.30.0
NewChannelWithSize returns a new Channel with a buffer of bufSize.
type PipeListener ¶
type PipeListener struct {
// contains filtered or unexported fields
}
PipeListener is a listener with an unbuffered pipe. Each write will complete only once the other side reads. It should only be created using NewPipeListener.
func NewPipeListener ¶
func NewPipeListener() *PipeListener
NewPipeListener creates a new pipe listener.
Click to show internal directories.
Click to hide internal directories.