Documentation ¶
Index ¶
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 ServeRoot ¶
func ServeRoot(urlPrefix, root string) gin.HandlerFunc
ServeRoot returns a middleware handler that serves from a filesystem directory.
Types ¶
type HTTPFileSystem ¶ added in v1.9.6
type HTTPFileSystem struct {
// contains filtered or unexported fields
}
HTTPFileSystem wraps around http.FileSystem.
func FileSystem ¶
func FileSystem(fs http.FileSystem) *HTTPFileSystem
FileSystem returns an HTTPFileSystem.
type LocalFileSystem ¶ added in v1.9.6
type LocalFileSystem struct { http.FileSystem // contains filtered or unexported fields }
LocalFileSystem represents a local file system.
func LocalFile ¶
func LocalFile(root string, indexes bool) *LocalFileSystem
LocalFile returns an instance of a LocalFileSystem serving from a specified directory.
type ServeFileSystem ¶
type ServeFileSystem interface { http.FileSystem Exists(prefix string, path string) bool }
ServeFileSystem represents a static filesystem that can be served.
Click to show internal directories.
Click to hide internal directories.