httpstatic

package
v0.0.0-test.2 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2023 License: AGPL-3.0 Imports: 10 Imported by: 209

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Root string

Functions

func Static

func Static(directory string, staticOpt ...StaticOptions) web.Handler

Static returns a middleware handler that serves static files in the given directory.

Types

type StaticOptions

type StaticOptions struct {
	// Prefix is the optional prefix used to serve the static directory content
	Prefix string
	// SkipLogging will disable [Static] log messages when a static file is served.
	SkipLogging bool
	// IndexFile defines which file to serve as index if it exists.
	IndexFile string
	// Expires defines which user-defined function to use for producing a HTTP Expires Header
	// https://developers.google.com/speed/docs/insights/LeverageBrowserCaching
	AddHeaders func(ctx *web.Context)
	// FileSystem is the interface for supporting any implementation of file system.
	FileSystem http.FileSystem
	// Exclude paths from being served
	Exclude []string
}

StaticOptions is a struct for specifying configuration options for the web.Static middleware.

Jump to

Keyboard shortcuts

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