iomisc

package
v0.0.0-...-fd2add7 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2016 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package iomisc implements miscellaneous I/O facilities

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Combine

func Combine(r1, r2 io.Reader) io.Reader

Combine returns an io.Reader that greedily reads from r1 and r2 in parallel

func Dup

func Dup(u io.Reader) (r1, r2 io.Reader)

Dup splits the reader src into two identical readers r1 and r2 that can be used out of sync.

func ForwardClose

func ForwardClose(_ string, sink io.WriteCloser, source io.Reader, eof func())

??

func MultiWriter

func MultiWriter(writers ...io.Writer) io.Writer

MultiWriter creates a writer that duplicates its writes to all the provided writers. Unlike io.MultiWriter, this one will process writes even if the writers are broken, making sure that writes to this writer never block.

func PrefixReader

func PrefixReader(p string, r io.Reader) io.Reader

PrefixReader returns a reader that reads from r, but only in chunks of entire lines and returns the lines on the other side prefixed by prefix.

func PrefixWriter

func PrefixWriter(prefix string, w io.Writer) io.Writer

PrefixWriter

func ReadCloserEOF

func ReadCloserEOF(r io.ReadCloser) io.ReadCloser

ReadCloserEOF returns an io.ReadCloser which will return an io.EOF error as soon as the reader r is empty.

func ReaderEOF

func ReaderEOF(r io.Reader) io.Reader

ReaderEOF returns an io.Reader which will return an io.EOF error as soon as the reader r is empty.

func ReaderEOFNopCloser

func ReaderEOFNopCloser(r io.Reader) io.ReadCloser

ReaderEOFNopCloser

func ReaderNopCloser

func ReaderNopCloser(r io.Reader) io.ReadCloser

ReaderNopCloser

func SniffClose

func SniffClose(name string, sink io.WriteCloser, source io.Reader, eof func())

??

Types

type Sniffer

type Sniffer struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func (*Sniffer) Close

func (s *Sniffer) Close() (err error)

func (*Sniffer) Printf

func (s *Sniffer) Printf(format string, arg ...interface{})

func (*Sniffer) Read

func (s *Sniffer) Read(p []byte) (n int, err error)

func (*Sniffer) Write

func (s *Sniffer) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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