io

package
v7.25.1 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadAll

func ReadAll(r io.Reader) ([]byte, error)

func SinkAll

func SinkAll(r io.Reader) (err error)

Types

type BytesNopCloser

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

func NewBytesNopCloser

func NewBytesNopCloser(b []byte) *BytesNopCloser

func (*BytesNopCloser) Bytes

func (nc *BytesNopCloser) Bytes() []byte

func (*BytesNopCloser) Close

func (nc *BytesNopCloser) Close() error

func (*BytesNopCloser) DetectLength added in v7.21.0

func (nc *BytesNopCloser) DetectLength() (int64, error)

func (*BytesNopCloser) Read

func (nc *BytesNopCloser) Read(p []byte) (int, error)

func (*BytesNopCloser) ReadAt

func (nc *BytesNopCloser) ReadAt(b []byte, off int64) (int, error)

func (*BytesNopCloser) Seek

func (nc *BytesNopCloser) Seek(offset int64, whence int) (int64, error)

func (*BytesNopCloser) Size

func (nc *BytesNopCloser) Size() int64

type KnownLength added in v7.21.0

type KnownLength interface {
	DetectLength() (int64, error)
}

type OffsetWriter added in v7.22.0

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

An OffsetWriter maps writes at offset base to offset base+off in the underlying writer.

func NewOffsetWriter added in v7.22.0

func NewOffsetWriter(w io.WriterAt, off int64) *OffsetWriter

NewOffsetWriter returns an OffsetWriter that writes to w starting at offset off.

func (*OffsetWriter) Seek added in v7.22.0

func (o *OffsetWriter) Seek(offset int64, whence int) (int64, error)

func (*OffsetWriter) Write added in v7.22.0

func (o *OffsetWriter) Write(p []byte) (n int, err error)

func (*OffsetWriter) WriteAt added in v7.22.0

func (o *OffsetWriter) WriteAt(p []byte, off int64) (n int, err error)

type ReadSeekCloser

type ReadSeekCloser interface {
	io.Reader
	io.Seeker
	io.Closer
}

func MakeReadSeekCloserFromLimitedReader

func MakeReadSeekCloserFromLimitedReader(r io.Reader, size int64) ReadSeekCloser

func MakeReadSeekCloserFromReader

func MakeReadSeekCloserFromReader(r io.Reader) ReadSeekCloser

type ReadSeekableNopCloser

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

func NewReadSeekableNopCloser

func NewReadSeekableNopCloser(r io.ReadSeeker) ReadSeekableNopCloser

func (ReadSeekableNopCloser) Close

func (nc ReadSeekableNopCloser) Close() error

func (ReadSeekableNopCloser) DetectLength added in v7.21.0

func (nc ReadSeekableNopCloser) DetectLength() (int64, error)

func (ReadSeekableNopCloser) Read

func (nc ReadSeekableNopCloser) Read(p []byte) (int, error)

func (ReadSeekableNopCloser) Seek

func (nc ReadSeekableNopCloser) Seek(offset int64, whence int) (int64, error)

Jump to

Keyboard shortcuts

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