io

package
v0.10.9 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsyncJoin added in v0.10.0

func AsyncJoin(c1 interfaces.ReadWriteCloseReportFlusher, c2 interfaces.ReadWriteCloseReportFlusher, chanSize int, timeOut int, bufSize int) (inCount int64, outCount int64, errors []error)

func Join

func Join(c1 io.ReadWriteCloser, c2 io.ReadWriteCloser) (inCount int64, outCount int64, errors []error)

Join two io.ReadWriteCloser and do some operations.

func WithAdaptiveEncoding

func WithAdaptiveEncoding(rwc io.ReadWriteCloser, reportFunc common.ReportFunction, bufSize int, compressType uint8) (out interfaces.ReadWriteCloseReportFlusher, recycle func())

use normal compression interface.

func WithAdaptiveEncoding3 added in v0.10.0

func WithAdaptiveEncoding3(rwc io.ReadWriteCloser, compressType uint8) (out interfaces.ReadWriteCloseReportFlusher)

func WithCompression

func WithCompression(rwc io.ReadWriteCloser) io.ReadWriteCloser

func WithCompressionFromPool

func WithCompressionFromPool(rwc io.ReadWriteCloser) (out io.ReadWriteCloser, recycle func())

WithCompressionFromPool will get snappy reader and writer from pool. You can recycle the snappy reader and writer by calling the returned recycle function, but it is not necessary.

func WithEncryption

func WithEncryption(rwc io.ReadWriteCloser, key []byte) (io.ReadWriteCloser, error)

func WrapReadWriteCloseReportFlusher added in v0.10.0

func WrapReadWriteCloseReportFlusher(r io.Reader, w interfaces.WriteFlusherReporter, closeFn func() error) interfaces.ReadWriteCloseReportFlusher

closeFn will be called only once

func WrapReadWriteCloseReportFlusher2 added in v0.10.0

func WrapReadWriteCloseReportFlusher2(rwc io.ReadWriteCloser) interfaces.ReadWriteCloseReportFlusher

func WrapReadWriteCloseReportFlusher3 added in v0.10.0

func WrapReadWriteCloseReportFlusher3(r io.Reader, w interfaces.WriteFlusher, closeFn func() error) interfaces.ReadWriteCloseReportFlusher

func WrapReadWriteCloser

func WrapReadWriteCloser(r io.Reader, w io.Writer, closeFn func() error) io.ReadWriteCloser

closeFn will be called only once

Types

type MockWriteFlusherReporter added in v0.10.0

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

func NewMockWriteFlusherReporter added in v0.10.0

func NewMockWriteFlusherReporter(w io.Writer) *MockWriteFlusherReporter

func (*MockWriteFlusherReporter) Flush added in v0.10.0

func (m *MockWriteFlusherReporter) Flush() error

func (*MockWriteFlusherReporter) Report added in v0.10.0

func (*MockWriteFlusherReporter) Write added in v0.10.0

func (m *MockWriteFlusherReporter) Write(p []byte) (n int, err error)

type MockWriteFlusherReporter2 added in v0.10.0

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

func NewMockWriteFlusherReporter2 added in v0.10.0

func NewMockWriteFlusherReporter2(w interfaces.WriteFlusher) *MockWriteFlusherReporter2

func (*MockWriteFlusherReporter2) Flush added in v0.10.0

func (m *MockWriteFlusherReporter2) Flush() error

func (*MockWriteFlusherReporter2) Report added in v0.10.0

func (*MockWriteFlusherReporter2) Write added in v0.10.0

func (m *MockWriteFlusherReporter2) Write(p []byte) (n int, err error)

type ReadWriteCloseReportFlusher added in v0.10.0

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

func (*ReadWriteCloseReportFlusher) Close added in v0.10.0

func (rwcrf *ReadWriteCloseReportFlusher) Close() error

func (*ReadWriteCloseReportFlusher) Flush added in v0.10.0

func (rwcrf *ReadWriteCloseReportFlusher) Flush() error

func (*ReadWriteCloseReportFlusher) Read added in v0.10.0

func (rwcrf *ReadWriteCloseReportFlusher) Read(p []byte) (n int, err error)

func (*ReadWriteCloseReportFlusher) Report added in v0.10.0

func (*ReadWriteCloseReportFlusher) Write added in v0.10.0

func (rwcrf *ReadWriteCloseReportFlusher) Write(p []byte) (n int, err error)

type ReadWriteCloser

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

func (*ReadWriteCloser) Close

func (rwc *ReadWriteCloser) Close() error

func (*ReadWriteCloser) Read

func (rwc *ReadWriteCloser) Read(p []byte) (n int, err error)

func (*ReadWriteCloser) Write

func (rwc *ReadWriteCloser) 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