26 lines
461 B
Plaintext
26 lines
461 B
Plaintext
// +build OMIT
|
|
package http
|
|
|
|
import (
|
|
"io"
|
|
"os"
|
|
)
|
|
|
|
func FileServer(root FileSystem) Handler
|
|
|
|
type FileSystem interface {
|
|
Open(name string) (File, error)
|
|
}
|
|
|
|
// A File is returned by a FileSystem's Open method and can be
|
|
// served by the FileServer implementation.
|
|
//
|
|
// The methods should behave the same as those on an *os.File.
|
|
type File interface {
|
|
io.Closer
|
|
io.Reader
|
|
io.Seeker
|
|
Readdir(count int) ([]os.FileInfo, error)
|
|
Stat() (os.FileInfo, error)
|
|
}
|