Documentation ¶
Index ¶
- Constants
- func EncodeResponse(response interface{}) []byte
- func GetSourceIPFromHeaders(r *http.Request) string
- func ParseForm(r *http.Request) error
- func SetCommonHeaders(w http.ResponseWriter)
- func TrimLeadingSlash(ep string) string
- func UnescapeQueryPath(ep string) (string, error)
- func WriteResponse(w http.ResponseWriter, statusCode int, response []byte, mType mimeType)
Constants ¶
View Source
const ( LastModified = "Last-Modified" Date = "Date" ETag = "ETag" ContentType = "Content-Type" ContentMD5 = "Content-Md5" ContentEncoding = "Content-Encoding" Expires = "Expires" ContentLength = "Content-Length" ContentLanguage = "Content-Language" ContentRange = "Content-Range" Connection = "Connection" AcceptRanges = "Accept-Ranges" AmzBucketRegion = "X-Amz-Bucket-Region" ServerInfo = "Server" RetryAfter = "Retry-After" Location = "Location" CacheControl = "Cache-Control" ContentDisposition = "Content-Disposition" Authorization = "Authorization" Action = "Action" Range = "Range" )
Standard S3 HTTP response constants
View Source
const ( // MimeNone Means no response type. MimeNone mimeType = "" // MimeJSON Means response type is JSON. MimeJSON mimeType = "application/json" // MimeXML Means response type is XML. MimeXML mimeType = "application/xml" )
Variables ¶
This section is empty.
Functions ¶
func EncodeResponse ¶
func EncodeResponse(response interface{}) []byte
EncodeResponse Encodes the response headers into XML format.
func GetSourceIPFromHeaders ¶
GetSourceIPFromHeaders retrieves the IP from the X-Forwarded-For, X-Real-IP and RFC7239 Forwarded headers (in that order)
func SetCommonHeaders ¶
func SetCommonHeaders(w http.ResponseWriter)
SetCommonHeaders writes http common headers
func TrimLeadingSlash ¶
TrimLeadingSlash Cleans and ensure there is a leading slash path in the URL
func UnescapeQueryPath ¶
UnescapeQueryPath URL unencode the path
func WriteResponse ¶
func WriteResponse(w http.ResponseWriter, statusCode int, response []byte, mType mimeType)
WriteResponse writes ressponse to http.ResponseWriter
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.