assets

package
v0.1.0-beta-007 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ServeBundles

func ServeBundles(dirPath string, debugMode bool) func(http.Handler) http.Handler

ServeBundles is a middleware which automatically discovers, bundles and minifies static web assets such as CSS and JavaScript files and handles all web requests to those assets.

Types

type Asset

type Asset struct {
	FullPath    string
	ContentType string
}

Asset holds information about a static asset.

type Bundle

type Bundle struct {
	FileName string
	Contents []byte
}

Bundle holds information of a minified asset bundle.

type Bundles

type Bundles struct {
	CSS    *Bundle
	JS     *Bundle
	Images map[string]Asset
}

Bundles holds information about all static web assets.

func GetBundles

func GetBundles() *Bundles

GetBundles returns an object of all bundled and minified assets.

Jump to

Keyboard shortcuts

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