codec

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package codec opens readers that undo HTTP content codings (br, gzip, deflate, zstd, identity), for whole bodies and for streams alike.

Index

Constants

This section is empty.

Variables

View Source
var ErrUnsupported = errors.New("unsupported content coding")

ErrUnsupported is returned for a content coding no reader exists for.

Functions

func Chain

func Chain(codings []string, r io.Reader) (io.Reader, func(), error)

Chain undoes codings, listed in header order (the last applied first).

func Name

func Name(coding string) string

Name is how messages name a coding: its library, e.g. zlib for deflate.

func NewReader

func NewReader(coding string, r io.Reader) (io.Reader, func(), error)

NewReader returns a reader undoing coding on r, and a function releasing its resources. A reader that fails to start (a bad header) returns the decoder's error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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