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 (local filesystem).
Root string `json:"root,omitempty"`
// S3 backend configuration (if set, takes precedence over Root).
S3 *S3Config `json:"s3,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.
type S3Config ¶ added in v0.2.0
type S3Config struct {
Endpoint string `json:"endpoint,omitempty"` // S3 endpoint (e.g. s3:9000)
Bucket string `json:"bucket,omitempty"` // Bucket name
Region string `json:"region,omitempty"` // Region (default us-east-1)
AccessKey string `json:"accessKey,omitempty"` // Access key ID
SecretKey string `json:"secretKey,omitempty"` // Secret access key
Prefix string `json:"prefix,omitempty"` // Key prefix
UseSSL bool `json:"useSSL,omitempty"` // Use HTTPS
}
S3Config holds S3 backend configuration.
Click to show internal directories.
Click to hide internal directories.