Documentation ¶
Index ¶
- Constants
- func EncodeXMLResponse(response interface{}) []byte
- func NotFoundHandler(w http.ResponseWriter, r *http.Request)
- func WriteAwsXMLResponse(w http.ResponseWriter, r *http.Request, statusCode int, result interface{})
- func WriteEmptyResponse(w http.ResponseWriter, r *http.Request, statusCode int)
- func WriteErrorResponse(w http.ResponseWriter, r *http.Request, errorCode ErrorCode)
- func WriteResponse(w http.ResponseWriter, r *http.Request, statusCode int, response []byte, ...)
- func WriteXMLResponse(w http.ResponseWriter, r *http.Request, statusCode int, response interface{})
- type APIError
- type BucketsResult
- type CopyObjectResult
- type ErrorCode
- type ListBucketResult
- type RESTErrorResponse
- type S3Gateway
- func (s3Gateway *S3Gateway) Download(w http.ResponseWriter, r *http.Request)
- func (s3Gateway *S3Gateway) HeadObject(w http.ResponseWriter, r *http.Request)
- func (s3Gateway *S3Gateway) ListBuckets(w http.ResponseWriter, r *http.Request)
- func (s3Gateway *S3Gateway) ListObjects(w http.ResponseWriter, r *http.Request)
- func (s3 S3Gateway) RegisterS3Routes(router *mux.Router)
- func (s3Gateway *S3Gateway) SetOptionHeaders(w http.ResponseWriter, r *http.Request)
- func (s3Gateway *S3Gateway) Upload(w http.ResponseWriter, r *http.Request)
Constants ¶
View Source
const (
MimeXML mimeType = "application/xml"
)
Variables ¶
This section is empty.
Functions ¶
func EncodeXMLResponse ¶
func EncodeXMLResponse(response interface{}) []byte
Encodes the response headers into XML format.
func NotFoundHandler ¶
func NotFoundHandler(w http.ResponseWriter, r *http.Request)
func WriteAwsXMLResponse ¶
func WriteAwsXMLResponse(w http.ResponseWriter, r *http.Request, statusCode int, result interface{})
func WriteEmptyResponse ¶
func WriteEmptyResponse(w http.ResponseWriter, r *http.Request, statusCode int)
func WriteErrorResponse ¶
func WriteErrorResponse(w http.ResponseWriter, r *http.Request, errorCode ErrorCode)
func WriteResponse ¶
func WriteXMLResponse ¶
func WriteXMLResponse(w http.ResponseWriter, r *http.Request, statusCode int, response interface{})
Types ¶
type APIError ¶
APIError structure
func GetAPIError ¶
GetAPIError provides API Error for input API error code.
type BucketsResult ¶
type CopyObjectResult ¶
type CopyObjectResult struct { ETag string `xml:"ETag"` LastModified time.Time `xml:"LastModified"` ChecksumCRC32 string `xml:"ChecksumCRC32"` ChecksumCRC32C string `xml:"ChecksumCRC32C"` ChecksumSHA1 string `xml:"ChecksumSHA1"` ChecksumSHA256 string `xml:"ChecksumSHA256"` }
CopyObjectResult upload object result
type ErrorCode ¶
type ErrorCode int
ErrorCode type of error status.
const ( ErrNone ErrorCode = iota ErrAccessDenied ErrMethodNotAllowed ErrBucketNotEmpty ErrBucketAlreadyExists ErrBucketAlreadyOwnedByYou ErrNoSuchBucket ErrNoSuchBucketPolicy ErrNoSuchCORSConfiguration ErrNoSuchLifecycleConfiguration ErrNoSuchKey ErrNoSuchUpload ErrInvalidBucketName ErrInvalidDigest ErrInvalidMaxKeys ErrInvalidMaxUploads ErrInvalidMaxParts ErrInvalidMaxDeleteObjects ErrInvalidPartNumberMarker ErrInvalidPart ErrInvalidRange ErrInternalError ErrInvalidCopyDest ErrInvalidCopySource ErrInvalidTag ErrAuthHeaderEmpty ErrSignatureVersionNotSupported ErrMalformedPOSTRequest ErrPOSTFileRequired ErrPostPolicyConditionInvalidFormat ErrEntityTooSmall ErrEntityTooLarge ErrMissingFields ErrMissingCredTag ErrCredMalformed ErrMalformedXML ErrMalformedDate ErrMalformedPresignedDate ErrMalformedCredentialDate ErrMissingSignHeadersTag ErrMissingSignTag ErrUnsignedHeaders ErrInvalidQueryParams ErrInvalidQuerySignatureAlgo ErrExpiredPresignRequest ErrMalformedExpires ErrNegativeExpires ErrMaximumExpires ErrSignatureDoesNotMatch ErrContentSHA256Mismatch ErrInvalidAccessKeyID ErrRequestNotReadyYet ErrMissingDateHeader ErrInvalidRequest ErrAuthNotSetup ErrNotImplemented ErrPreconditionFailed ErrExistingObjectIsDirectory ErrExistingObjectIsFile ErrTooManyRequest ErrRequestBytesExceed OwnershipControlsNotFoundError )
Error codes, see full list at http://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html
type ListBucketResult ¶
type RESTErrorResponse ¶
type RESTErrorResponse struct { XMLName xml.Name `xml:"Error" json:"-"` Code string `xml:"Code" json:"Code"` Message string `xml:"Message" json:"Message"` Resource string `xml:"Resource" json:"Resource"` RequestID string `xml:"RequestId" json:"RequestId"` Key string `xml:"Key,omitempty" json:"Key,omitempty"` BucketName string `xml:"BucketName,omitempty" json:"BucketName,omitempty"` // Underlying HTTP status code for the returned error StatusCode int `xml:"-" json:"-"` }
RESTErrorResponse - error response format
func (RESTErrorResponse) Error ¶
func (e RESTErrorResponse) Error() string
Error - Returns S3 error string.
type S3Gateway ¶
Provide S3 API implementation
func NewS3Gateway ¶
func (*S3Gateway) Download ¶
func (s3Gateway *S3Gateway) Download(w http.ResponseWriter, r *http.Request)
func (*S3Gateway) HeadObject ¶
func (s3Gateway *S3Gateway) HeadObject(w http.ResponseWriter, r *http.Request)
func (*S3Gateway) ListBuckets ¶
func (s3Gateway *S3Gateway) ListBuckets(w http.ResponseWriter, r *http.Request)
func (*S3Gateway) ListObjects ¶
func (s3Gateway *S3Gateway) ListObjects(w http.ResponseWriter, r *http.Request)
func (S3Gateway) RegisterS3Routes ¶
func (*S3Gateway) SetOptionHeaders ¶
func (s3Gateway *S3Gateway) SetOptionHeaders(w http.ResponseWriter, r *http.Request)
Click to show internal directories.
Click to hide internal directories.