Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileServer ¶
type FileServer struct {
// contains filtered or unexported fields
}
func New ¶
func New(route, dir string, options ...Option) *FileServer
New returns a new file server that can handle requests for files using an in-memory store with gzipping
func (*FileServer) Delete ¶ added in v0.4.0
func (fs *FileServer) Delete(key string) error
func (*FileServer) Flush ¶ added in v0.4.0
func (fs *FileServer) Flush() error
Flush clears all data from cache
func (*FileServer) Handle ¶
func (fs *FileServer) Handle() http.HandlerFunc
Handle gives a handlerfunc for the file server
func (*FileServer) ServeHTTP ¶
func (fs *FileServer) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP is the server of the file server
type Option ¶
type Option func(fs *FileServer)
Option is the type all options need to adhere to
func OptionMaxBytes ¶
OptionMaxBytes sets the maximum number of bytes per file to cache, the default is 10 MB
Click to show internal directories.
Click to hide internal directories.