handler

package
v2.0.0-beta3 Latest Latest
Warning

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

Go to latest
Published: May 27, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleCompression

func HandleCompression(next http.Handler, compressTypes sets.Set[string]) http.Handler

HandleCompression wraps an HTTP response in a compression writer. Compress types is a sets.Set[string] of mime types like: "text/plain", "application/json", etc. Any matching ContentType handled by the compression handler will be compressed

Types

type ResponseEncoder

type ResponseEncoder interface {
	Write([]byte) (int, error)
	Header() http.Header
	WriteHeader(int)
	Close() error
}

ResponseEncoder defines the ResponseEncoder interface for encoding responses just-in-time

func NewEncoder

NewEncoder returns a new ResponseEncoder

Jump to

Keyboard shortcuts

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