FS Type — fiber Architecture
Architecture documentation for the FS type/interface in res.go from the fiber codebase.
Entity Profile
Dependency Diagram
graph TD dc0f7a80_a50a_4978_da90_2db76bfb278c["FS"] 4ab93de8_955a_4087_8264_32cf8000452f["res.go"] dc0f7a80_a50a_4978_da90_2db76bfb278c -->|defined in| 4ab93de8_955a_4087_8264_32cf8000452f style dc0f7a80_a50a_4978_da90_2db76bfb278c fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
res.go lines 27–63
type SendFile struct {
// FS is the file system to serve the static files from.
// You can use interfaces compatible with fs.FS like embed.FS, os.DirFS etc.
//
// Optional. Default: nil
FS fs.FS
// When set to true, the server tries minimizing CPU usage by caching compressed files.
// This works differently than the github.com/gofiber/compression middleware.
// You have to set Content-Encoding header to compress the file.
// Available compression methods are gzip, br, and zstd.
//
// Optional. Default: false
Compress bool `json:"compress"`
// When set to true, enables byte range requests.
//
// Optional. Default: false
ByteRange bool `json:"byte_range"`
// When set to true, enables direct download.
//
// Optional. Default: false
Download bool `json:"download"`
// Expiration duration for inactive file handlers.
// Use a negative time.Duration to disable it.
//
// Optional. Default: 10 * time.Second
CacheDuration time.Duration `json:"cache_duration"`
// The value for the Cache-Control HTTP-header
// that is set on the file response. MaxAge is defined in seconds.
//
// Optional. Default: 0
MaxAge int `json:"max_age"`
}
Defined In
Source
Frequently Asked Questions
What is the FS type?
FS is a type/interface in the fiber codebase, defined in res.go.
Where is FS defined?
FS is defined in res.go at line 27.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free