Documentation
¶
Index ¶
Constants ¶
View Source
const INDEX = "index.html"
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 ServeRoot ¶
func ServeRoot(urlPrefix, root string) gin.HandlerFunc
Types ¶
type ServeFileSystem ¶
type ServeFileSystem interface { http.FileSystem Exists(prefix string, path string) bool }
func EmbedFolder ¶ added in v1.1.0
func EmbedFolder(fsEmbed embed.FS, targetPath string) (ServeFileSystem, error)
EmbedFolder function embeds the target folder from the embedded file system into the ServeFileSystem. If an error occurs during the embedding process, it returns the error message.
Click to show internal directories.
Click to hide internal directories.