core: v2ray.com/core/transport/pipe Index | Files

package pipe

import "v2ray.com/core/transport/pipe"

Index

Package Files

impl.go pipe.go reader.go writer.go

func New Uses

func New(opts ...Option) (*Reader, *Writer)

New creates a new Reader and Writer that connects to each other.

type Option Uses

type Option func(*pipeOption)

Option for creating new Pipes.

func DiscardOverflow Uses

func DiscardOverflow() Option

DiscardOverflow returns an Option for Pipe to discard writes if full.

func OptionsFromContext Uses

func OptionsFromContext(ctx context.Context) []Option

OptionsFromContext returns a list of Options from context.

func WithSizeLimit Uses

func WithSizeLimit(limit int32) Option

WithSizeLimit returns an Option for Pipe to have the given size limit.

func WithoutSizeLimit Uses

func WithoutSizeLimit() Option

WithoutSizeLimit returns an Option for Pipe to have no size limit.

type Reader Uses

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

Reader is a buf.Reader that reads content from a pipe.

func (*Reader) Interrupt Uses

func (r *Reader) Interrupt()

Interrupt implements common.Interruptible.

func (*Reader) ReadMultiBuffer Uses

func (r *Reader) ReadMultiBuffer() (buf.MultiBuffer, error)

ReadMultiBuffer implements buf.Reader.

func (*Reader) ReadMultiBufferTimeout Uses

func (r *Reader) ReadMultiBufferTimeout(d time.Duration) (buf.MultiBuffer, error)

ReadMultiBufferTimeout reads content from a pipe within the given duration, or returns buf.ErrTimeout otherwise.

type Writer Uses

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

Writer is a buf.Writer that writes data into a pipe.

func (*Writer) Close Uses

func (w *Writer) Close() error

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) Interrupt Uses

func (w *Writer) Interrupt()

Interrupt implements common.Interruptible.

func (*Writer) WriteMultiBuffer Uses

func (w *Writer) WriteMultiBuffer(mb buf.MultiBuffer) error

WriteMultiBuffer implements buf.Writer.

Package pipe imports 11 packages (graph) and is imported by 14 packages. Updated 2019-03-29. Refresh now. Tools for package owners.