Movatterモバイル変換


[0]ホーム

URL:


precompress

package
v1.92.2Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2025 License:BSD-3-ClauseImports:11Imported by:5

Details

Repository

github.com/tailscale/tailscale

Links

Documentation

Overview

Package precompress provides build- and serving-time support forprecompressed static resources, to avoid the cost of repeatedly compressingunchanging resources.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

funcOpenPrecompressedFile

func OpenPrecompressedFile(whttp.ResponseWriter, r *http.Request, pathstring, fsfs.FS) (fs.File,error)

OpenPrecompressedFile opens a file from fs, preferring compressed versionsgenerated by PrecompressDir if possible.

funcPrecompressadded inv1.34.0

func Precompress(pathstring, optionsOptions)error

funcPrecompressDir

func PrecompressDir(dirPathstring, optionsOptions)error

PrecompressDir compresses static assets in dirPath using Gzip and Brotli, sothat they can be later served with OpenPrecompressedFile.

Types

typeOptions

type Options struct {// FastCompression controls whether compression should be optimized for// speed rather than size.FastCompressionbool// ProgressFn, if non-nil, is invoked when a file in the directory is about// to be compressed.ProgressFn func(pathstring)}

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp