// options the constraints of the object. Only when the object meets the requirements this method will return the metadata. Otherwise returns error. Valid options are IfModifiedSince, IfUnmodifiedSince,
// IfMatch, IfNoneMatch. For more details check out https://help.aliyun.com/document_detail/oss/api-reference/object/HeadObject.html
// IfMatch, IfNoneMatch. For more details check out https://www.alibabacloud.com/help/en/object-storage-service/latest/headobject
//
// http.Header object meta when error is nil.
// error it's nil if no error, otherwise it's an error object.
// rules the lifecycle rules. There're two kind of rules: absolute time expiration and relative time expiration in days and day/month/year respectively.
// SetBucketReferer sets the bucket's referer whitelist and the flag if allowing empty referrer.
//
// To avoid stealing link on OSS data, OSS supports the HTTP referrer header. A whitelist referrer could be set either by API or web console, as well as
// the allowing empty referrer flag. Note that this applies to requests from webbrowser only.
// the allowing empty referrer flag. Note that this applies to requests from webbrowser only.
// For example, for a bucket os-example and its referrer http://www.aliyun.com, all requests from this URL could access the bucket.
// For more information, please check out this link :
// SetBucketWebsite sets the bucket's static website's index and error page.
//
// OSS supports static web site hosting for the bucket data. When the bucket is enabled with that, you can access the file in the bucket like the way to access a static website.
// For more information, please check out: https://help.aliyun.com/document_detail/oss/user_guide/static_host_website.html
// For more information, please check out: https://www.alibabacloud.com/help/en/object-storage-service/latest/putbucketwebsite
//
// bucketName the bucket name to enable static web site.
// SetBucketWebsiteDetail sets the bucket's static website's detail
//
// OSS supports static web site hosting for the bucket data. When the bucket is enabled with that, you can access the file in the bucket like the way to access a static website.
// For more information, please check out: https://help.aliyun.com/document_detail/oss/user_guide/static_host_website.html
// For more information, please check out: https://www.alibabacloud.com/help/en/object-storage-service/latest/putbucketwebsite
//
// bucketName the bucket name to enable static web site.
// SetBucketWebsiteXml sets the bucket's static website's rule
//
// OSS supports static web site hosting for the bucket data. When the bucket is enabled with that, you can access the file in the bucket like the way to access a static website.
// For more information, please check out: https://help.aliyun.com/document_detail/oss/user_guide/static_host_website.html
// For more information, please check out: https://www.alibabacloud.com/help/en/object-storage-service/latest/putbucketwebsite
//
// bucketName the bucket name to enable static web site.
// DoMetaQuery Queries the objects that meet specified conditions and lists the information about objects based on specified fields and sorting methods.
// DoMetaQueryXml Queries the objects that meet specified conditions and lists the information about objects based on specified fields and sorting methods.
//
// bucketName the bucket name
//
// metaQuery the option of query
//
// DoMetaQueryResult the result object upon successful request. It's only valid when error is nil.
// error it's nil if no error, otherwise it's an error object.
iferrIn!=nil{// error unmarshaling the error response
err=fmt.Errorf("oss: service returned invalid response body, status = %s, RequestId = %s",resp.Status,resp.Header.Get(HTTPHeaderOssRequestID))
iferrIn!=nil{// error unmarshal the error response
iflen(resp.Header.Get(HTTPHeaderOssEc))>0{
err=fmt.Errorf("oss: service returned invalid response body, status = %s, RequestId = %s, ec = %s",resp.Status,resp.Header.Get(HTTPHeaderOssRequestID),resp.Header.Get(HTTPHeaderOssEc))
}else{
err=fmt.Errorf("oss: service returned invalid response body, status = %s, RequestId = %s",resp.Status,resp.Header.Get(HTTPHeaderOssRequestID))
RequestIDstring`xml:"RequestId"`// The UUID used to uniquely identify the request
HostIDstring`xml:"HostId"`// The OSS server cluster's Id
Endpointstring`xml:"Endpoint"`
Ecstring`xml:"EC"`
RawMessagestring// The raw messages from OSS
StatusCodeint// HTTP status code
}
// Error implements interface error
func(eServiceError)Error()string{
ife.Endpoint==""{
returnfmt.Sprintf("oss: service returned error: StatusCode=%d, ErrorCode=%s, ErrorMessage=\"%s\", RequestId=%s",
e.StatusCode,e.Code,e.Message,e.RequestID)
errorStr:=fmt.Sprintf("oss: service returned error: StatusCode=%d, ErrorCode=%s, ErrorMessage=\"%s\", RequestId=%s",e.StatusCode,e.Code,e.Message,e.RequestID)
// InitiateMultipartUploadResult the return value of the InitiateMultipartUpload, which is used for calls later on such as UploadPartFromFile,UploadPartCopy.
// error it's nil if the operation succeeds, otherwise it's an error object.