testio

package
v0.0.0-...-2147502 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2021 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package testio provides Readers and Writers for testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ThroughputReader

type ThroughputReader struct {
	// contains filtered or unexported fields
}

A ThroughputReader limits read throughput.

func NewThroughputReader

func NewThroughputReader(ctx context.Context, r io.Reader, msec int) *ThroughputReader

NewThroughputReader creates a ThroughputReader that limits throughput to msec mebibytes per second.

func (*ThroughputReader) Read

func (r *ThroughputReader) Read(buf []byte) (int, error)

Read implements io.Reader.

type ThroughputWriter

type ThroughputWriter struct {
	// contains filtered or unexported fields
}

A ThroughputWriter limits write throughput.

func NewThroughputWriter

func NewThroughputWriter(ctx context.Context, w io.Writer, msec int) *ThroughputWriter

NewThroughputWriter creates a ThroughputWriter that limits throughput to msec mebibytes per second.

func (*ThroughputWriter) Write

func (w *ThroughputWriter) Write(buf []byte) (int, error)

Write implements io.Write.

Jump to

Keyboard shortcuts

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