Documentation ¶
Overview ¶
Package serve provides static file serving functions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewStaticFileHandler ¶
func NewStaticFileHandler(debug bool, urlPrefix, staticUrl string, startupTime time.Time, fileProvider FileProvider) fasthttp.RequestHandler
NewStaticFileHandler returns a static handler for fasthttp with advanced caching and url prefix stripping.
Types ¶
type File ¶
type File interface { io.Closer io.Reader io.Seeker // Name returns abstract path of file. Name() string // Stat returns a os.FileInfo describing the named file. // If there is an error, it will be of type *os.PathError. Stat() (os.FileInfo, error) // Hash returns a file content checksum that is used for the e-tags. Hash() []byte }
File defines a abstract file object,which provides caching hash.
type FileProvider ¶
FileProvider is an alias of the file resolver function.
Click to show internal directories.
Click to hide internal directories.