Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Buster = random(10)
Buster is used as the cache buster slug
Functions ¶
func DefaultBuildBuster ¶
func DefaultBuildBuster(s *FileServer) string
func DefaultBuildURL ¶
func DefaultBuildURL(path string, s *FileServer) string
func DefaultStripBuster ¶
func DefaultStripBuster(p string, s *FileServer) (string, bool)
Types ¶
type FileServer ¶
type FileServer struct { RootDir string // File system directory that will be served Prefix string // URL prefix Buster string // Cache buster that will be added to the Prefix Host string // include for absolute urls (example http://example.com) DisableCache bool // don't cache BuildBusterFunc func(s *FileServer) string // func used to build the path prefix StripBusterFunc func(path string, s *FileServer) (string, bool) // func used to strip the prefix BuildURLFunc func(path string, s *FileServer) string // func use to create URLs with the cache buster // contains filtered or unexported fields }
func NewFileServer ¶
func NewFileServer(rootDir, prefix string) *FileServer
func (*FileServer) GinFunc ¶
func (s *FileServer) GinFunc() gin.HandlerFunc
GinFunc returns a gin middleware func
Click to show internal directories.
Click to hide internal directories.