Documentation ¶
Overview ¶
Package http provides a mockable wrapper for net/http.
Index ¶
- type Impl
- func (*Impl) AllowQuerySemicolons(h http.Handler) http.Handler
- func (*Impl) CanonicalHeaderKey(s string) string
- func (*Impl) DetectContentType(data []byte) string
- func (*Impl) Error(w http.ResponseWriter, error string, code int)
- func (*Impl) FS(fsys fs.FS) http.FileSystem
- func (*Impl) FileServer(root http.FileSystem) http.Handler
- func (*Impl) Get(url string) (resp *http.Response, err error)
- func (*Impl) Handle(pattern string, handler http.Handler)
- func (*Impl) HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request))
- func (*Impl) Head(url string) (resp *http.Response, err error)
- func (*Impl) ListenAndServe(addr string, handler http.Handler) error
- func (*Impl) ListenAndServeTLS(addr string, certFile string, keyFile string, handler http.Handler) error
- func (*Impl) MaxBytesHandler(h http.Handler, n int64) http.Handler
- func (*Impl) MaxBytesReader(w http.ResponseWriter, r io.ReadCloser, n int64) io.ReadCloser
- func (*Impl) NewFileTransport(fs http.FileSystem) http.RoundTripper
- func (*Impl) NewRequest(method string, url string, body io.Reader) (*http.Request, error)
- func (*Impl) NewRequestWithContext(ctx context.Context, method string, url string, body io.Reader) (*http.Request, error)
- func (*Impl) NewServeMux() *http.ServeMux
- func (*Impl) NotFound(w http.ResponseWriter, r *http.Request)
- func (*Impl) NotFoundHandler() http.Handler
- func (*Impl) ParseHTTPVersion(vers string) (major int, minor int, ok bool)
- func (*Impl) ParseTime(text string) (t time.Time, err error)
- func (*Impl) Post(url string, contentType string, body io.Reader) (resp *http.Response, err error)
- func (*Impl) PostForm(url string, data url.Values) (resp *http.Response, err error)
- func (*Impl) ProxyFromEnvironment(req *http.Request) (*url.URL, error)
- func (*Impl) ProxyURL(fixedURL *url.URL) func(*http.Request) (*url.URL, error)
- func (*Impl) ReadRequest(b *bufio.Reader) (*http.Request, error)
- func (*Impl) ReadResponse(r *bufio.Reader, req *http.Request) (*http.Response, error)
- func (*Impl) Redirect(w http.ResponseWriter, r *http.Request, url string, code int)
- func (*Impl) RedirectHandler(url string, code int) http.Handler
- func (*Impl) Serve(l net.Listener, handler http.Handler) error
- func (*Impl) ServeContent(w http.ResponseWriter, req *http.Request, name string, modtime time.Time, ...)
- func (*Impl) ServeFile(w http.ResponseWriter, r *http.Request, name string)
- func (*Impl) ServeTLS(l net.Listener, handler http.Handler, certFile string, keyFile string) error
- func (*Impl) SetCookie(w http.ResponseWriter, cookie *http.Cookie)
- func (*Impl) StatusText(code int) string
- func (*Impl) StripPrefix(prefix string, h http.Handler) http.Handler
- func (*Impl) TimeoutHandler(h http.Handler, dt time.Duration, msg string) http.Handler
- type Interface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Impl ¶
type Impl struct{}
func (*Impl) CanonicalHeaderKey ¶
func (*Impl) DetectContentType ¶
func (*Impl) FileServer ¶
func (*Impl) FileServer(root http.FileSystem) http.Handler
func (*Impl) HandleFunc ¶
func (*Impl) ListenAndServeTLS ¶
func (*Impl) MaxBytesReader ¶
func (*Impl) MaxBytesReader(w http.ResponseWriter, r io.ReadCloser, n int64) io.ReadCloser
func (*Impl) NewFileTransport ¶
func (*Impl) NewFileTransport(fs http.FileSystem) http.RoundTripper
func (*Impl) NewRequest ¶
func (*Impl) NewRequestWithContext ¶
func (*Impl) NewServeMux ¶
func (*Impl) NotFoundHandler ¶
func (*Impl) ParseHTTPVersion ¶
func (*Impl) ProxyFromEnvironment ¶
func (*Impl) ReadResponse ¶
func (*Impl) ServeContent ¶
func (*Impl) ServeContent(w http.ResponseWriter, req *http.Request, name string, modtime time.Time, content io.ReadSeeker)
func (*Impl) StatusText ¶
type Interface ¶
type Interface interface { AllowQuerySemicolons(h http.Handler) http.Handler CanonicalHeaderKey(s string) string DetectContentType(data []byte) string Error(w http.ResponseWriter, error string, code int) FS(fsys fs.FS) http.FileSystem FileServer(root http.FileSystem) http.Handler Get(url string) (resp *http.Response, err error) Handle(pattern string, handler http.Handler) HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request)) Head(url string) (resp *http.Response, err error) ListenAndServe(addr string, handler http.Handler) error ListenAndServeTLS(addr string, certFile string, keyFile string, handler http.Handler) error MaxBytesHandler(h http.Handler, n int64) http.Handler MaxBytesReader(w http.ResponseWriter, r io.ReadCloser, n int64) io.ReadCloser NewFileTransport(fs http.FileSystem) http.RoundTripper NewRequest(method string, url string, body io.Reader) (*http.Request, error) NewRequestWithContext(ctx context.Context, method string, url string, body io.Reader) (*http.Request, error) NewServeMux() *http.ServeMux NotFound(w http.ResponseWriter, r *http.Request) NotFoundHandler() http.Handler ParseHTTPVersion(vers string) (major int, minor int, ok bool) ParseTime(text string) (t time.Time, err error) Post(url string, contentType string, body io.Reader) (resp *http.Response, err error) PostForm(url string, data url.Values) (resp *http.Response, err error) ProxyFromEnvironment(req *http.Request) (*url.URL, error) ProxyURL(fixedURL *url.URL) func(*http.Request) (*url.URL, error) ReadRequest(b *bufio.Reader) (*http.Request, error) ReadResponse(r *bufio.Reader, req *http.Request) (*http.Response, error) Redirect(w http.ResponseWriter, r *http.Request, url string, code int) RedirectHandler(url string, code int) http.Handler Serve(l net.Listener, handler http.Handler) error ServeContent(w http.ResponseWriter, req *http.Request, name string, modtime time.Time, content io.ReadSeeker) ServeFile(w http.ResponseWriter, r *http.Request, name string) ServeTLS(l net.Listener, handler http.Handler, certFile string, keyFile string) error SetCookie(w http.ResponseWriter, cookie *http.Cookie) StatusText(code int) string StripPrefix(prefix string, h http.Handler) http.Handler TimeoutHandler(h http.Handler, dt time.Duration, msg string) http.Handler }
Directories ¶
Path | Synopsis |
---|---|
Package cgi provides a mockable wrapper for net/http/cgi.
|
Package cgi provides a mockable wrapper for net/http/cgi. |
Package cookiejar provides a mockable wrapper for net/http/cookiejar.
|
Package cookiejar provides a mockable wrapper for net/http/cookiejar. |
Package fcgi provides a mockable wrapper for net/http/fcgi.
|
Package fcgi provides a mockable wrapper for net/http/fcgi. |
Package httptest provides a mockable wrapper for net/http/httptest.
|
Package httptest provides a mockable wrapper for net/http/httptest. |
Package httptrace provides a mockable wrapper for net/http/httptrace.
|
Package httptrace provides a mockable wrapper for net/http/httptrace. |
Package httputil provides a mockable wrapper for net/http/httputil.
|
Package httputil provides a mockable wrapper for net/http/httputil. |
Package pprof provides a mockable wrapper for net/http/pprof.
|
Package pprof provides a mockable wrapper for net/http/pprof. |
Click to show internal directories.
Click to hide internal directories.