Documentation ¶
Overview ¶
Package httputil provides HTTP utility functions.
Index ¶
- func AcceptEncoding(h http.Header, encoding string) bool
- func ExtractOpenGraphImage(r io.Reader) (string, error)
- func ExtractOpenGraphTitle(r io.Reader) (string, error)
- func FileServer(root http.FileSystem) http.Handler
- func Get(url string) (*http.Response, error)
- func GetIP(r *http.Request) string
- func GzipHandler(h http.Handler) http.Handler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AcceptEncoding ¶
AcceptEncoding returns true if h contains encoding in an Accept-Encoding HTTP header.
func ExtractOpenGraphImage ¶
ExtractOpenGraphImage returns the Open Graph image tag of the HTML document in r.
func ExtractOpenGraphTitle ¶
ExtractOGTItle returns the Open Graph title tag found in the HTML document in r.
func FileServer ¶
func FileServer(root http.FileSystem) http.Handler
FileServer is like http.FileServer except if name.gz file is found, it's assumed to be gzipped, and is served instead without the .gz suffix (if all appropriate request headers are present).
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.