Documentation ¶
Index ¶
- func LocalFile(root string, indexes bool) *localFileSystem
- func Serve(urlPrefix string, fs ServeFileSystem) gin.HandlerFunc
- func ServeCached(urlPrefix string, fs ServeFileSystem, cacheAge uint) gin.HandlerFunc
- func ServeEmbed(reqPath string, fsEmbed embed.FS) gin.HandlerFunc
- func ServeRoot(urlPrefix, root string) gin.HandlerFunc
- type Override
- type ServeFileSystem
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Serve ¶
func Serve(urlPrefix string, fs ServeFileSystem) gin.HandlerFunc
Serve returns a middleware handler that serves static files in the given directory.
func ServeCached ¶ added in v0.2.0
func ServeCached(urlPrefix string, fs ServeFileSystem, cacheAge uint) gin.HandlerFunc
ServeCached returns a middleware handler that similar as Serve but with the Cache-Control Header set as passed in the cacheAge parameter
func ServeEmbed ¶ added in v0.2.0
func ServeEmbed(reqPath string, fsEmbed embed.FS) gin.HandlerFunc
func ServeRoot ¶
func ServeRoot(urlPrefix, root string) gin.HandlerFunc
Types ¶
type ServeFileSystem ¶
type ServeFileSystem interface { http.FileSystem Exists(prefix string, path string) bool Override(*gin.Context) bool }
func EmbedFolder ¶ added in v0.2.0
Click to show internal directories.
Click to hide internal directories.