ioutil

package
v0.63.4 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: MIT Imports: 3 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadAllOrError

func ReadAllOrError(r io.Reader) []byte

ReadAllOrError will successfully return the data or return the error in the value return value. This is useful to simply test scripts where the data is printed for debugging or testing.

func ReaderToBytes

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

ReaderToBytes reads from an io.Reader, e.g. io.ReadCloser

func ReaderToReadSeeker added in v0.47.0

func ReaderToReadSeeker(r io.Reader) (io.ReadSeeker, error)

ReaderToReadSeeker converts an `io.Reader` to an `io.ReadSeeker`. It does this by reading all data in `io.Reader`.

func Write added in v0.45.0

func Write(w *bufio.Writer, r io.Reader) error

Write writes from `Writer` to a `Reader`. See `osutil.WriteFileReader()`.

Types

type AtReader added in v0.49.0

type AtReader interface {
	io.Reader
	io.ReaderAt
}

type SkipWriter added in v0.49.0

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

SkipWriter is an `io.Writer` that skips writing the first `n` bytes passed. This is useful when the `io.Writer` writes some undesirable data which will be omitted with this functionality.

func NewSkipWriter added in v0.49.0

func NewSkipWriter(w io.Writer, off int) *SkipWriter

NewSkipWriter returns an SkipWriter that writes to w skipping the first offset off bytes.

func (*SkipWriter) Write added in v0.49.0

func (s *SkipWriter) Write(p []byte) (n int, err error)

Write fulfills the `io.Writer` interface.

Jump to

Keyboard shortcuts

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