tee

package
v0.5.8 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2020 License: Apache-2.0 Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package tee implements utilities for I/O multiplexing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Writer

type Writer sync.Map

Write is an asynchronous write multiplexer. Write maintains a small internal buffer but may discard writes for writers that cannot keep up; thus it is meant for log output or similar.

func (*Writer) Tee

func (w *Writer) Tee(wr io.Writer) (cancel func())

Tee forwards future writes from this writer to wr; forwarding stops after the return cancelation function is invoked. A small buffer is maintained for each writer, but writes are dropped if the writer wr cannot keep up with the write volume. The writer is not forwarded any more writes if returns an error.

func (*Writer) Write

func (w *Writer) Write(p []byte) (n int, err error)

Write writes p to each writer that is managed by this multiplexer. Write is asynchronous, and always returns len(p), nil.

Jump to

Keyboard shortcuts

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