utility

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2014 License: LGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UncheckedParallelMultiWriter

func UncheckedParallelMultiWriter(writers ...io.Writer) io.Writer

Types

type ChannelReader

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

Contains all information about a file or reader to be read

func (*ChannelReader) WriteTo

func (p *ChannelReader) WriteTo(w io.Writer) (n int64, err error)

Allows to use a ChannelReader as source for io.Copy operations This should be preferred as it will save a copy operation WriteTo will block until a Reader is ready to serve us bytes Note that the read operation is performed by N reader routines - we just receive the data and pass it on Also we assume that write blocks until the operation is finished. If you perform non-blocking writes, you must copy the buffer !

type ChannelWriter

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

type ReadChannelController

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

func NewReadChannelController

func NewReadChannelController(nprocs int) ReadChannelController

Create a new parallel reader with nprocs go-routines and return a channel to it. Feed the channel with ChannelReader structures and listen on it's channel to read bytes until EOF, which is when the channel will be closed by the reader

func (*ReadChannelController) Channel

func (r *ReadChannelController) Channel() chan<- ChannelReader

func (*ReadChannelController) NewChannelReaderFromPath

func (r *ReadChannelController) NewChannelReaderFromPath(path string) ChannelReader

Return a new channel reader You should set either path

func (*ReadChannelController) NewChannelReaderFromReader

func (r *ReadChannelController) NewChannelReaderFromReader(reader io.Reader) ChannelReader

type WriteChannelController

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

func NewWriteChannelController

func NewWriteChannelController(nprocs int) WriteChannelController

Create a new controller which deals with writing all incoming requests with nprocs go-routines

Jump to

Keyboard shortcuts

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