testutils

package
v1.28.1 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package testutils provides utility types, for use in xds tests.

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

This section is empty.

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

func NewChannelWithSize(bufSize int) *Channel

NewChannelWithSize returns a new Channel with a buffer of bufSize.

func (*Channel) Receive

func (cwt *Channel) Receive() (interface{}, error)

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

func (cwt *Channel) TimedReceive(timeout time.Duration) (interface{}, error)

TimedReceive returns the value received on the underlying channel, or ErrRecvTimeout if timeout amount of time elapsed.

Directories

Path Synopsis
Package fakeclient provides a fake implementation of an xDS client.
Package fakeclient provides a fake implementation of an xDS client.
Package fakeserver provides a fake implementation of an xDS server.
Package fakeserver provides a fake implementation of an xDS server.

Jump to

Keyboard shortcuts

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