stream

package
v0.1.17 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCloseOnErrorReader

func NewCloseOnErrorReader(readCloser io.ReadCloser, callBack func() error) io.Reader

NewCloseOnErrorReader creates a new CloseOnErrorReader

Types

type CloseOnErrorReader

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

CloseOnErrorReader closes reader on any error (includes EOF) and execute a callback function. This is useful when caller wants to read until EOF and cleans up after error when Close() is not guaranteed to be called.

func (*CloseOnErrorReader) Close

func (r *CloseOnErrorReader) Close() error

Close implement io.ReadCloser.Close

func (*CloseOnErrorReader) Read

func (r *CloseOnErrorReader) Read(p []byte) (int, error)

Read implements io.Reader.Read

type ConcurrentMultiWriter

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

ConcurrentMultiWriter is a concurrent implementation of the io.MultiWriter of the standard library.

func NewConcurrentMultiWriter

func NewConcurrentMultiWriter(writers ...io.Writer) *ConcurrentMultiWriter

NewConcurrentMultiWriter returns a new ConcurrentMultiWriter.

func (*ConcurrentMultiWriter) Write

func (w *ConcurrentMultiWriter) Write(p []byte) (int, error)

Write implements io.Writer.

Jump to

Keyboard shortcuts

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