Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Option ¶
type Option func(*pipeOption)
Option for creating new Pipes.
func DiscardOverflow ¶
func DiscardOverflow() Option
DiscardOverflow returns an Option for Pipe to discard writes if full.
func OptionsFromContext ¶
OptionsFromContext returns a list of Options from context.
func WithSizeLimit ¶
WithSizeLimit returns an Option for Pipe to have the given size limit.
func WithoutSizeLimit ¶
func WithoutSizeLimit() Option
WithoutSizeLimit returns an Option for Pipe to have no size limit.
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader is a buf.Reader that reads content from a pipe.
func (*Reader) Close ¶
Close implements io.Closer. After the pipe is closed, writing to the pipe will return io.ErrClosedPipe, while reading will return io.EOF.
func (*Reader) ReadMultiBuffer ¶
func (r *Reader) ReadMultiBuffer() (buf.MultiBuffer, error)
ReadMultiBuffer implements buf.Reader.
func (*Reader) ReadMultiBufferTimeout ¶
ReadMultiBufferTimeout reads content from a pipe within the given duration, or returns buf.ErrTimeout otherwise.
func (*Reader) ReturnAnError ¶
ReturnAnError makes ReadMultiBuffer return an error, only once.
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
Writer is a buf.Writer that writes data into a pipe.
func (*Writer) Close ¶
Close implements io.Closer. After the pipe is closed, writing to the pipe will return io.ErrClosedPipe, while reading will return io.EOF.
func (*Writer) WriteMultiBuffer ¶
func (w *Writer) WriteMultiBuffer(mb buf.MultiBuffer) error
WriteMultiBuffer implements buf.Writer.