precompress

package
v1.104.1 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: BSD-3-Clause Imports: 9 Imported by: 5

Documentation

Overview

Package precompress provides build-time support for precompressing static resources (using Zstandard), to avoid the cost of repeatedly compressing unchanging resources. Serving the resulting variants is handled by tailscale.com/tsweb/compserve.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Precompress added in v1.34.0

func Precompress(path string, options Options) error

func PrecompressDir

func PrecompressDir(dirPath string, options Options) error

PrecompressDir compresses static assets in dirPath using Zstandard.

Types

type Options

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

Jump to

Keyboard shortcuts

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