Documentation ¶
Index ¶
- Constants
- Variables
- func App(fsys fs.FS, indexFile string, opts ...Option) http.Handler
- func Bytes(w http.ResponseWriter, r *http.Request, data []byte, opts ...Option) (int64, error)
- func Error(w http.ResponseWriter, err error)
- func FSFile(w http.ResponseWriter, r *http.Request, fsys fs.FS, name string, ...) (int64, error)
- func File(w http.ResponseWriter, r *http.Request, f fs.File, opts ...Option) (int64, error)
- func Handle(w http.ResponseWriter, r *http.Request, fn func() (int64, error))
- func JSON(w http.ResponseWriter, r *http.Request, v interface{}, opts ...Option) (int64, error)
- func Reader(rw http.ResponseWriter, req *http.Request, r io.Reader, opts ...Option) (int64, error)
- type Option
Constants ¶
View Source
const ( IndexFileName = "index.html" DefaultRangeBufferSize = 1 << 22 // 4 MiB MimeHeader = "Content-Type" SizeHeader = "Content-Length" ModTimeHeader = "Last-Modified" DispositionHeader = "Content-Disposition" )
Variables ¶
View Source
var ErrMethodNotAllowed = errors.New("method not allowed")
View Source
var (
JSONMime = Mime("application/json; charset=utf-8")
)
Functions ¶
func Error ¶
func Error(w http.ResponseWriter, err error)
Types ¶
Click to show internal directories.
Click to hide internal directories.