Documentation
¶
Index ¶
- Constants
- func AllowCredentials(w http.ResponseWriter)
- func AllowHeaders(w http.ResponseWriter, Headers ...string)
- func AllowMethods(w http.ResponseWriter, Methods ...string)
- func AllowOrigin(w http.ResponseWriter, value string)
- func AllowOriginAll(w http.ResponseWriter)
- func CheckAcceptEncoding(r *http.Request, compressType string) bool
- func DelHeader(w http.ResponseWriter, key string)
- func GetRequestHeader(r *http.Request, key string) (value string)
- func GetResponseHeader(w http.ResponseWriter, key string) (value string)
- func MaxAge(w http.ResponseWriter, age int)
- func SetCharset(w http.ResponseWriter, charset string)
- func SetContentEncoding(w http.ResponseWriter, compressType string)
- func SetContentLength(w http.ResponseWriter, length int)
- func SetContentType(w http.ResponseWriter, value string)
- func SetContentTypeWithCharset(w http.ResponseWriter, value string, charset string)
- func SetHeader(w http.ResponseWriter, key, value string)
- func WriteHeader(w http.ResponseWriter, code int)
Constants ¶
View Source
const ( ContentEncoding = "Content-Encoding" ContentLanguage = "Content-Language" ContentLength = "Content-Length" ContentLocation = "Content-Location" ContentMD5 = "Content-MD5" ContentRange = "Content-Range" ContentType = "Content-Type" AcceptRanges = "Accept-Ranges" Bytes = "bytes" AcceptEncoding = "Accept-Encoding" GZIP = "gzip" DEFLATE = "deflate" Vary = "Vary" Charset = "charset" CharsetPrefix = "charset=" UTF8 = "UTF-8" GB18030 = "GB18030" GBK = "GBK" Semicolon = ";" Comma = "," ContentTypeJSON = "application/json" ContentTypeXML = "text/xml" ContentTypeHTML = "text/html" ContentTypeText = "text/plain" AccessControlAllowOrigin = "Access-Control-Allow-Origin" AccessControlAllowCredentials = "Access-Control-Allow-Credentials" AccessControlMaxAge = "Access-Control-Max-Age" AccessControlAllowMethods = "Access-Control-Allow-Methods" AccessControlAllowHeaders = "Access-Control-Allow-Headers" )
Variables ¶
This section is empty.
Functions ¶
func AllowCredentials ¶
func AllowCredentials(w http.ResponseWriter)
func AllowHeaders ¶
func AllowHeaders(w http.ResponseWriter, Headers ...string)
func AllowMethods ¶
func AllowMethods(w http.ResponseWriter, Methods ...string)
func AllowOrigin ¶
func AllowOrigin(w http.ResponseWriter, value string)
func AllowOriginAll ¶
func AllowOriginAll(w http.ResponseWriter)
func DelHeader ¶
func DelHeader(w http.ResponseWriter, key string)
func GetResponseHeader ¶
func GetResponseHeader(w http.ResponseWriter, key string) (value string)
func MaxAge ¶
func MaxAge(w http.ResponseWriter, age int)
func SetCharset ¶
func SetCharset(w http.ResponseWriter, charset string)
func SetContentEncoding ¶
func SetContentEncoding(w http.ResponseWriter, compressType string)
func SetContentLength ¶
func SetContentLength(w http.ResponseWriter, length int)
func SetContentType ¶
func SetContentType(w http.ResponseWriter, value string)
func SetContentTypeWithCharset ¶
func SetContentTypeWithCharset(w http.ResponseWriter, value string, charset string)
func SetHeader ¶
func SetHeader(w http.ResponseWriter, key, value string)
func WriteHeader ¶
func WriteHeader(w http.ResponseWriter, code int)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.