Documentation ¶
Index ¶
Constants ¶
View Source
const ( METHOD_GET = "GET" METHOD_POST = "POST" METHOD_TRACE = "TRACE" METHOD_DELETE = "DELETE" METHOD_PUT = "PUT" METHOD_OPTIONS = "OPTIONS" METHOD_HEAD = "HEAD" METHOD_CONNECT = "CONNECT" CONTENT_TYPE_X_WWW_FORM_URLENCODED = "application/x-www-form-urlencoded" CONTENT_TYPE_JSON = "application/json" CONTENT_TYPE_MULTIPART = "multipart/form-data" )
Variables ¶
This section is empty.
Functions ¶
func ServeContent ¶
func ServeContent(w http.ResponseWriter, r *http.Request, name string, modtime time.Time, content io.ReadSeeker, size int64)
ServeContent if name is empty, filename is unknown. (used for mime type, before sniffing) if modtime.IsZero(), modtime is unknown. content must be seeked to the beginning of the file. The sizeFunc is called at most once. Its error, if any, is sent in the HTTP response.
Types ¶
type File ¶
type File interface { io.Closer io.Reader io.Seeker Readdir(count int) ([]os.FileInfo, error) Stat() (os.FileInfo, 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 FileSystem ¶
A FileSystem implements access to a collection of named files. The elements in a file path are separated by slash ('/', U+002F) characters, regardless of host operating system convention.
Click to show internal directories.
Click to hide internal directories.