public

package
v1.14.0-rc5 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2021 License: MIT Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var KnownPublicEntries = []string{
	"css",
	"img",
	"js",
	"serviceworker.js",
	"vendor",
	"favicon.ico",
}

KnownPublicEntries list all direct children in the `public` directory

Functions

func Custom added in v1.1.0

func Custom(opts *Options) func(next http.Handler) http.Handler

Custom implements the static handler for serving custom assets.

func ServeContent

func ServeContent(w http.ResponseWriter, req *http.Request, fi os.FileInfo, modtime time.Time, content io.ReadSeeker)

ServeContent serve http content

func Static

func Static(opts *Options) func(next http.Handler) http.Handler

Static implements the static handler for serving assets.

func StaticHandler added in v1.5.0

func StaticHandler(dir string, opts *Options) func(next http.Handler) http.Handler

StaticHandler sets up a new middleware for serving static files in the

Types

type Options

type Options struct {
	Directory   string
	IndexFile   string
	SkipLogging bool
	FileSystem  http.FileSystem
	Prefix      string
}

Options represents the available options to configure the handler.

Jump to

Keyboard shortcuts

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