v1util

package
v0.0.0-...-ec4d356 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GunzipReadCloser

func GunzipReadCloser(r io.ReadCloser) (io.ReadCloser, error)

GunzipReadCloser reads compressed input data from the io.ReadCloser and returns an io.ReadCloser from which uncompessed data may be read.

func GzipReadCloser

func GzipReadCloser(r io.ReadCloser) (io.ReadCloser, error)

GzipReadCloser reads uncompressed input data from the io.ReadCloser and returns an io.ReadCloser from which compressed data may be read. This uses gzip.BestSpeed for the compression level.

func GzipReadCloserLevel

func GzipReadCloserLevel(r io.ReadCloser, level int) (io.ReadCloser, error)

GzipReadCloserLevel reads uncompressed input data from the io.ReadCloser and returns an io.ReadCloser from which compressed data may be read. Refer to compress/gzip for the level: https://golang.org/pkg/compress/gzip/#pkg-constants

func IsGzipped

func IsGzipped(r io.Reader) (bool, error)

IsGzipped detects whether the input stream is compressed.

func VerifyReadCloser

func VerifyReadCloser(r io.ReadCloser, h v1.Hash) (io.ReadCloser, error)

VerifyReadCloser wraps the given io.ReadCloser to verify that its contents match the provided v1.Hash before io.EOF is returned.

Types

This section is empty.

Jump to

Keyboard shortcuts

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