minify

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// HTML mime type for comparison
	HTML = "text/html"
	// CSS mime type for comparison
	CSS = "text/css"
	// Javascript mime type for comparison
	Javascript = "application/javascript"
	// SVG mime type for comparison
	SVG = "image/svg+xml"
	// JSON mime type for comparison
	JSON = "application/json"
	// XML mime type for comparison
	XML = "text/xml"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	MinifyHTML bool
	MinifyCSS  bool
	MinifyJS   bool
	MinifySVG  bool
	MinifyJSON bool
	MinifyXML  bool
}

Config represents the options for minifying output.

type Minifier

type Minifier interface {
	Minify(name string, mime string) ([]byte, error)
	MinifyBytes(b *bytes.Buffer, mime string) ([]byte, error)
}

Minifier represents functions for executing the minify package.

func New

func New(cfg ...Config) Minifier

New

Creates a new Minify instance, if no config options are passed the defaultConfig is used.

Jump to

Keyboard shortcuts

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