compress

package
v0.0.0-...-e1f4ce8 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(config Config) gx.Plugin

New creates a new compression plugin with the given configuration

Types

type Algorithm

type Algorithm int

Algorithm represents a compression algorithm

const (
	// Gzip compression
	Gzip Algorithm = iota
	// Brotli compression
	Brotli
)

type Config

type Config struct {
	// Algorithms is the list of allowed compression algorithms in order of preference
	Algorithms []Algorithm

	// MinSize is the minimum response size to compress (in bytes)
	MinSize int

	// Level is the compression level (-1 = default, 0 = no compression, 1-9 for gzip)
	Level int
}

Config holds compression configuration

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns the default compression configuration

Jump to

Keyboard shortcuts

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