assets

package
v3.18.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2022 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LogFilter = dlog.FilterFunc(func(msg string) bool {
	return !(strings.HasPrefix(msg, "HTTP/1.1 ") &&
		(strings.HasSuffix(msg, ".css") ||
			strings.HasSuffix(msg, ".js") ||
			strings.HasSuffix(msg, ".svg") ||
			strings.HasSuffix(msg, ".jpg") ||
			strings.HasSuffix(msg, ".png")))
})

LogFilter is a dlog.Filter which filters logs during asset initialisation.

Functions

This section is empty.

Types

type Bundle

type Bundle struct {
	VirtualFileName string
	Contents        []byte
}

type Middleware

type Middleware struct {
	CSS *Bundle
	JS  *Bundle
	// contains filtered or unexported fields
}

func NewMiddleware

func NewMiddleware(
	ctx context.Context,
	dirPath string,
	cacheDirective string,
	devMode bool,
) (*Middleware, error)

func (*Middleware) Next

func (m *Middleware) Next(next http.Handler) http.HandlerFunc

Jump to

Keyboard shortcuts

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