gzip

package
v0.15.2 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package gzip provides a streaming object for taking in io.ReadCloser that is being written to and providing an io.ReadCloser that outputs the original content gzip compressed.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compress added in v0.6.0

func Compress(payload io.Reader) io.Reader

Types

type Streamer

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

Streamer implements an io.ReadCloser that converts data from a non-compressed stream to a compressed stream.

func New

func New() *Streamer

New creates a new streamer object. Use Reset() to initialize it.

func (*Streamer) Close

func (s *Streamer) Close() error

Close implements io.Closer.

func (*Streamer) InputSize added in v0.6.0

func (s *Streamer) InputSize() int64

InputSize returns the amount of data that the Streamer streamed. This will only be accurate for the full stream after Read() has returned io.EOF and not before.

func (*Streamer) Read

func (s *Streamer) Read(b []byte) (int, error)

Read implements io.Reader.

func (*Streamer) Reset

func (s *Streamer) Reset(reader io.ReadCloser)

Reset resets the streamer object to defaults and accepts the io.ReadCloser. You can only use Reset after a previous reader has closed.

Jump to

Keyboard shortcuts

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