Documentation
¶
Index ¶
- Constants
- func ContainsDotDot(v string) bool
- func HandleDirPrelude(w http.ResponseWriter, r *http.Request, dirstat os.FileInfo) (finished bool)
- func HttpFileServer(root http.FileSystem) http.Handler
- func New(root http.FileSystem) mchain.Handler
- func NewEx(root http.FileSystem, notFoundHandler mchain.Handler) mchain.Handler
- func ServeFile(w http.ResponseWriter, r *http.Request, name string) error
- func ServeRequestPath(w http.ResponseWriter, r *http.Request, root http.FileSystem) error
- type Err
- type FileServer
- type FileServerEx
Constants ¶
View Source
const ( ErrBadRequest fileServerErrorKind = iota ErrRedirect ErrFsOpen ErrFsStat ErrDirFound )
Variables ¶
This section is empty.
Functions ¶
func ContainsDotDot ¶
func HandleDirPrelude ¶
func HttpFileServer ¶
func HttpFileServer(root http.FileSystem) http.Handler
func ServeRequestPath ¶
func ServeRequestPath(w http.ResponseWriter, r *http.Request, root http.FileSystem) error
Types ¶
type FileServer ¶
type FileServer struct {
// contains filtered or unexported fields
}
func (*FileServer) ServeHTTP ¶
func (f *FileServer) ServeHTTP(w http.ResponseWriter, r *http.Request) error
type FileServerEx ¶
type FileServerEx struct { FileServer RedirectsEnabled bool NotFoundHandler mchain.Handler }
func (*FileServerEx) ServeHTTP ¶
func (f *FileServerEx) ServeHTTP(w http.ResponseWriter, r *http.Request) error
Click to show internal directories.
Click to hide internal directories.