compression

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2019 License: MIT Imports: 3 Imported by: 4 modules, 9 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Gzip

type Gzip struct {
	*Options
}

Gzip compression support

func NewGzip

func NewGzip() *Gzip

NewGzip creates a Gzip + Options variable

func (*Gzip) Compress

func (gz *Gzip) Compress(content []byte) ([]byte, error)

Compress to gzip

type Options

type Options struct {
	// activates the compression
	// default: false
	Compress bool

	// valid values are:
	// -> "NoCompression"
	// -> "BestSpeed"
	// -> "BestCompression"
	// -> "DefaultCompression"
	//
	// default: "DefaultCompression" // when: Compress == true && Method == ""
	Method string

	// true = do it yourself (the file is written as gzip into the memory file system)
	// false = decompress at run time (while writing file into memory file system)
	// default: false
	Keep bool
}

Options for compression

Jump to

Keyboard shortcuts

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