ioutils

package
v0.40.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GzipIt

func GzipIt(input []byte) ([]byte, error)

GzipIt compresses the input ([]byte)

func IsGzip

func IsGzip(input []byte) bool

IsGzip returns checks if the file contents are gzip compressed

func IsWasm

func IsWasm(input []byte) bool

IsWasm checks if the file contents are of wasm binary

func LimitReader

func LimitReader(r io.Reader, n int64) io.Reader

LimitReader returns a Reader that reads from r but stops with types.ErrLimit after n bytes. The underlying implementation is a *io.LimitedReader.

func Uncompress

func Uncompress(gzipSrc []byte, limit uint64) ([]byte, error)

Uncompress expects a valid gzip source to unpack or fails. See IsGzip

Types

type LimitedReader

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

func (*LimitedReader) Read

func (l *LimitedReader) Read(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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