Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FileServer ¶ added in v1.1.0
FileServer is a FileServerHandler with the NotFound handler set to http.NotFound.
func FileServerHandler ¶ added in v1.1.1
func FileServerHandler(root string, notFound http.HandlerFunc) http.Handler
FileServerHandler creates a file server that serves files from from a "Root" folder. It will call "NotFound" HandlerFunc if the file cannot be found on the system. In the event where the path is a directory, it will not redirect and instead call "NotFound" HandlerFunc.
Types ¶
type Server ¶
type Server struct {
Addr string // TCP address to listen on, ":http" if empty
Handler http.Handler // handler to invoke, http.DefaultServeMux if nil
Timeout time.Duration // Timeout to wait for shutdown
}
Server will create a http.Server from the Go standard library
func (*Server) ListenAndServe ¶
ListenAndServe mirrors the function from the Go standard library ListenAndServe always returns a non-nil error
Click to show internal directories.
Click to hide internal directories.