Documentation
¶
Index ¶
Constants ¶
View Source
const ( // EmptyPrefix is the empty prefix for the key. EmptyPrefix = "" // DefaultIndexFile is the default index file to return if path is not found. DefaultIndexFile = "index.html" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
// Next defines a function to skip this middleware when returned true.
//
// Optional. Default: nil
Next func(c fiber.Ctx) bool
// Storage is the storage backend for the files.
// This can be Azure Blob Storage, S3, or any other storage backend.
Storage fiber.Storage
// Prefix is a prefix for the key.
Prefix string `json:"prefix"`
// The value for the Cache-Control HTTP-header
// that is set on the file response. MaxAge is defined in seconds.
//
// Optional. Default value 0.
MaxAge int `json:"max_age"`
// File to return if path is not found. Useful for SPA's.
//
// Optional. Default: ""
NotFoundFile string `json:"not_found_file"`
// The value for the Content-Type HTTP-header
// that is set on the file response
//
// Optional. Default: ""
ContentTypeCharset string `json:"content_type_charset"`
// File that is served if the path is not a file.
//
// Optional. Default: "index.html"
IndexFile string `json:"index_file"`
}
Config defines the config for middleware.
Click to show internal directories.
Click to hide internal directories.