Documentation
¶
Overview ¶
Package static provides a static file server middleware for Hanzo Ingress.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
// Root directory to serve files from.
Root string `json:"root,omitempty"`
// EnableDirectoryListing enables directory listing.
EnableDirectoryListing bool `json:"enableDirectoryListing,omitempty"`
// IndexFiles is a list of filenames to try when a directory is requested.
IndexFiles []string `json:"indexFiles,omitempty"`
// SPAMode redirects all not-found requests to a single page.
SPAMode bool `json:"spaMode,omitempty"`
// SPAIndex is the file to serve in SPA mode.
SPAIndex string `json:"spaIndex,omitempty"`
// ErrorPage404 is the path to a custom 404 error page.
ErrorPage404 string `json:"errorPage404,omitempty"`
// CacheControl sets cache control headers for static files.
CacheControl map[string]string `json:"cacheControl,omitempty"`
}
Config holds the static file server middleware configuration.
func CreateConfig ¶
func CreateConfig() *Config
CreateConfig creates the default plugin configuration.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler is a static file server handler.
func (*Handler) GetTracingInformation ¶
GetTracingInformation returns the middleware name and type for observability.
Click to show internal directories.
Click to hide internal directories.