2017-03-04 05:06:32 -05:00
|
|
|
|
package oss
|
|
|
|
|
|
|
|
|
|
import "os"
|
|
|
|
|
|
2019-10-28 17:31:07 -04:00
|
|
|
|
// ACLType Bucket/Object的访问控制
|
2017-03-04 05:06:32 -05:00
|
|
|
|
type ACLType string
|
|
|
|
|
|
|
|
|
|
const (
|
2019-10-28 17:31:07 -04:00
|
|
|
|
// ACLPrivate 私有读写
|
2017-03-04 05:06:32 -05:00
|
|
|
|
ACLPrivate ACLType = "private"
|
|
|
|
|
|
2019-10-28 17:31:07 -04:00
|
|
|
|
// ACLPublicRead 公共读私有写
|
2017-03-04 05:06:32 -05:00
|
|
|
|
ACLPublicRead ACLType = "public-read"
|
|
|
|
|
|
2019-10-28 17:31:07 -04:00
|
|
|
|
// ACLPublicReadWrite 公共读写
|
2017-03-04 05:06:32 -05:00
|
|
|
|
ACLPublicReadWrite ACLType = "public-read-write"
|
|
|
|
|
|
2019-10-28 17:31:07 -04:00
|
|
|
|
// ACLDefault Object默认权限,Bucket无此权限
|
2017-03-04 05:06:32 -05:00
|
|
|
|
ACLDefault ACLType = "default"
|
|
|
|
|
)
|
|
|
|
|
|
2019-10-28 17:31:07 -04:00
|
|
|
|
// MetadataDirectiveType 对象COPY时新对象是否使用原对象的Meta
|
2017-03-04 05:06:32 -05:00
|
|
|
|
type MetadataDirectiveType string
|
|
|
|
|
|
|
|
|
|
const (
|
2019-10-28 17:31:07 -04:00
|
|
|
|
// MetaCopy 目标对象使用源对象的META
|
2017-03-04 05:06:32 -05:00
|
|
|
|
MetaCopy MetadataDirectiveType = "COPY"
|
|
|
|
|
|
2019-10-28 17:31:07 -04:00
|
|
|
|
// MetaReplace 目标对象使用自定义的META
|
2017-03-04 05:06:32 -05:00
|
|
|
|
MetaReplace MetadataDirectiveType = "REPLACE"
|
|
|
|
|
)
|
|
|
|
|
|
2019-10-28 17:31:07 -04:00
|
|
|
|
// Http头标签
|
2017-03-04 05:06:32 -05:00
|
|
|
|
const (
|
|
|
|
|
HTTPHeaderAcceptEncoding string = "Accept-Encoding"
|
|
|
|
|
HTTPHeaderAuthorization = "Authorization"
|
|
|
|
|
HTTPHeaderCacheControl = "Cache-Control"
|
|
|
|
|
HTTPHeaderContentDisposition = "Content-Disposition"
|
|
|
|
|
HTTPHeaderContentEncoding = "Content-Encoding"
|
|
|
|
|
HTTPHeaderContentLength = "Content-Length"
|
|
|
|
|
HTTPHeaderContentMD5 = "Content-MD5"
|
|
|
|
|
HTTPHeaderContentType = "Content-Type"
|
|
|
|
|
HTTPHeaderContentLanguage = "Content-Language"
|
|
|
|
|
HTTPHeaderDate = "Date"
|
|
|
|
|
HTTPHeaderEtag = "ETag"
|
|
|
|
|
HTTPHeaderExpires = "Expires"
|
|
|
|
|
HTTPHeaderHost = "Host"
|
|
|
|
|
HTTPHeaderLastModified = "Last-Modified"
|
|
|
|
|
HTTPHeaderRange = "Range"
|
|
|
|
|
HTTPHeaderLocation = "Location"
|
|
|
|
|
HTTPHeaderOrigin = "Origin"
|
|
|
|
|
HTTPHeaderServer = "Server"
|
|
|
|
|
HTTPHeaderUserAgent = "User-Agent"
|
|
|
|
|
HTTPHeaderIfModifiedSince = "If-Modified-Since"
|
|
|
|
|
HTTPHeaderIfUnmodifiedSince = "If-Unmodified-Since"
|
|
|
|
|
HTTPHeaderIfMatch = "If-Match"
|
|
|
|
|
HTTPHeaderIfNoneMatch = "If-None-Match"
|
|
|
|
|
|
|
|
|
|
HTTPHeaderOssACL = "X-Oss-Acl"
|
|
|
|
|
HTTPHeaderOssMetaPrefix = "X-Oss-Meta-"
|
|
|
|
|
HTTPHeaderOssObjectACL = "X-Oss-Object-Acl"
|
|
|
|
|
HTTPHeaderOssSecurityToken = "X-Oss-Security-Token"
|
|
|
|
|
HTTPHeaderOssServerSideEncryption = "X-Oss-Server-Side-Encryption"
|
|
|
|
|
HTTPHeaderOssCopySource = "X-Oss-Copy-Source"
|
|
|
|
|
HTTPHeaderOssCopySourceRange = "X-Oss-Copy-Source-Range"
|
|
|
|
|
HTTPHeaderOssCopySourceIfMatch = "X-Oss-Copy-Source-If-Match"
|
|
|
|
|
HTTPHeaderOssCopySourceIfNoneMatch = "X-Oss-Copy-Source-If-None-Match"
|
|
|
|
|
HTTPHeaderOssCopySourceIfModifiedSince = "X-Oss-Copy-Source-If-Modified-Since"
|
|
|
|
|
HTTPHeaderOssCopySourceIfUnmodifiedSince = "X-Oss-Copy-Source-If-Unmodified-Since"
|
|
|
|
|
HTTPHeaderOssMetadataDirective = "X-Oss-Metadata-Directive"
|
|
|
|
|
HTTPHeaderOssNextAppendPosition = "X-Oss-Next-Append-Position"
|
|
|
|
|
HTTPHeaderOssRequestID = "X-Oss-Request-Id"
|
|
|
|
|
HTTPHeaderOssCRC64 = "X-Oss-Hash-Crc64ecma"
|
|
|
|
|
)
|
|
|
|
|
|
2019-10-28 17:31:07 -04:00
|
|
|
|
// 其它常量
|
2017-03-04 05:06:32 -05:00
|
|
|
|
const (
|
2019-10-28 17:31:07 -04:00
|
|
|
|
MaxPartSize = 5 * 1024 * 1024 * 1024 // 文件片最大值,5GB
|
|
|
|
|
MinPartSize = 100 * 1024 // 文件片最小值,100KBß
|
2017-03-04 05:06:32 -05:00
|
|
|
|
|
2019-10-28 17:31:07 -04:00
|
|
|
|
FilePermMode = os.FileMode(0664) // 新建文件默认权限
|
2017-03-04 05:06:32 -05:00
|
|
|
|
|
2019-10-28 17:31:07 -04:00
|
|
|
|
TempFilePrefix = "oss-go-temp-" // 临时文件前缀
|
|
|
|
|
TempFileSuffix = ".temp" // 临时文件后缀
|
2017-03-04 05:06:32 -05:00
|
|
|
|
|
2019-10-28 17:31:07 -04:00
|
|
|
|
CheckpointFileSuffix = ".cp" // Checkpoint文件后缀
|
2017-03-04 05:06:32 -05:00
|
|
|
|
|
2019-10-28 17:31:07 -04:00
|
|
|
|
Version = "1.3.0" // Go sdk版本
|
2017-03-04 05:06:32 -05:00
|
|
|
|
)
|