package testreader

import "github.com/uber/tchannel-go/testutils/testreader"

Index

Variables

var ErrUser = errors.New("error set by user")

ErrUser is returned by ChunkReader when the user requests an error.

Functions

func ChunkReader

func ChunkReader() (chan<- []byte, io.Reader)

ChunkReader returns a reader that returns chunks written to the control channel. The caller should write byte chunks to return to the channel, or write nil if they want the Reader to return an error. The control channel should be closed to signal EOF.

func Looper

func Looper(bs []byte) io.Reader

Looper returns a reader that will return the bytes in bs as if it was a circular buffer.

Source Files

chunk.go loop.go

Version
v1.34.6 (latest)
Published
Jan 8, 2025
Platform
darwin/amd64
Imports
2 packages
Last checked
21 hours ago

Tools for package owners.