Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FileServer ¶
func FileServer(root http.FileSystem) http.Handler
FileServer returns a handler that serves HTTP requests with the contents of the file system rooted at root.
As a special case, the returned file server redirects any request ending in "/index.html" to the same path, without the final "index.html".
To use the operating system's file system implementation, use http.Dir:
http.Handle("/", http.FileServer(http.Dir("/tmp")))
To use an fs.FS implementation, use http.FS to convert it:
http.Handle("/", http.FileServer(http.FS(fsys)))
func GetRequestScheme ¶ added in v1.4.0
Types ¶
type HSTSMiddleware ¶ added in v1.4.0
type HSTSMiddleware struct {
// contains filtered or unexported fields
}
func NewHSTSMiddleware ¶ added in v1.4.0
func (*HSTSMiddleware) ServeHTTP ¶ added in v1.4.0
func (o *HSTSMiddleware) ServeHTTP(w http.ResponseWriter, r *http.Request)
type OembedMiddleware ¶ added in v1.3.0
func NewOembedMiddleware ¶ added in v1.3.0
func NewOembedMiddleware(next http.Handler, urlStr string) (*OembedMiddleware, error)
func (*OembedMiddleware) ServeHTTP ¶ added in v1.3.0
func (o *OembedMiddleware) ServeHTTP(w http.ResponseWriter, r *http.Request)
Click to show internal directories.
Click to hide internal directories.