package testutils
import "google.golang.org/grpc/xds/internal/testutils"
Package testutils provides utility types, for use in xds tests.
Index ¶
Constants ¶
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 ¶
ErrRecvTimeout is an error to indicate that a receive operation on the channel timed out.
Types ¶
type Channel ¶
type Channel struct {
// contains filtered or unexported fields
}
Channel wraps a generic channel and provides a timed receive operation.
func NewChannel ¶
func NewChannel() *Channel
NewChannel returns a new Channel.
func NewChannelWithSize ¶
NewChannelWithSize returns a new Channel with a buffer of bufSize.
func (*Channel) Receive ¶
Receive returns the value received on the underlying channel, or ErrRecvTimeout if DefaultChanRecvTimeout amount of time elapses.
func (*Channel) Send ¶
func (cwt *Channel) Send(value interface{})
Send sends value on the underlying channel.
func (*Channel) TimedReceive ¶
TimedReceive returns the value received on the underlying channel, or ErrRecvTimeout if timeout amount of time elapsed.
Source Files ¶
channel.go
Directories ¶
Path | Synopsis |
---|---|
xds/internal/testutils/fakeclient | Package fakeclient provides a fake implementation of an xDS client. |
xds/internal/testutils/fakeserver | Package fakeserver provides a fake implementation of an xDS server. |
- Version
- v1.27.1
- Published
- Feb 5, 2020
- Platform
- linux/amd64
- Imports
- 2 packages
- Last checked
- 6 minutes ago –
Tools for package owners.