const.go 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. package oss
  2. import "os"
  3. // ACLType Bucket/Object的访问控制
  4. type ACLType string
  5. const (
  6. // ACLPrivate 私有读写
  7. ACLPrivate ACLType = "private"
  8. // ACLPublicRead 公共读私有写
  9. ACLPublicRead ACLType = "public-read"
  10. // ACLPublicReadWrite 公共读写
  11. ACLPublicReadWrite ACLType = "public-read-write"
  12. // ACLDefault Object默认权限,Bucket无此权限
  13. ACLDefault ACLType = "default"
  14. )
  15. // MetadataDirectiveType 对象COPY时新对象是否使用原对象的Meta
  16. type MetadataDirectiveType string
  17. const (
  18. // MetaCopy 目标对象使用源对象的META
  19. MetaCopy MetadataDirectiveType = "COPY"
  20. // MetaReplace 目标对象使用自定义的META
  21. MetaReplace MetadataDirectiveType = "REPLACE"
  22. )
  23. // StorageClassType Bucket的存储类型
  24. type StorageClassType string
  25. const (
  26. // StorageStandard 标准存储模式
  27. StorageStandard StorageClassType = "Standard"
  28. // StorageIA 低频存储模式
  29. StorageIA StorageClassType = "IA"
  30. // StorageArchive 归档存储模式
  31. StorageArchive StorageClassType = "Archive"
  32. )
  33. // HTTPMethod HTTP请求方法
  34. type HTTPMethod string
  35. const (
  36. // HTTPGet HTTP请求方法 GET
  37. HTTPGet HTTPMethod = "GET"
  38. // HTTPPut HTTP请求方法 PUT
  39. HTTPPut HTTPMethod = "PUT"
  40. // HTTPHead HTTP请求方法 HEAD
  41. HTTPHead HTTPMethod = "HEAD"
  42. // HTTPPost HTTP请求方法 POST
  43. HTTPPost HTTPMethod = "POST"
  44. // HTTPDelete HTTP请求方法 DELETE
  45. HTTPDelete HTTPMethod = "DELETE"
  46. )
  47. // Http头标签
  48. const (
  49. HTTPHeaderAcceptEncoding string = "Accept-Encoding"
  50. HTTPHeaderAuthorization = "Authorization"
  51. HTTPHeaderCacheControl = "Cache-Control"
  52. HTTPHeaderContentDisposition = "Content-Disposition"
  53. HTTPHeaderContentEncoding = "Content-Encoding"
  54. HTTPHeaderContentLength = "Content-Length"
  55. HTTPHeaderContentMD5 = "Content-MD5"
  56. HTTPHeaderContentType = "Content-Type"
  57. HTTPHeaderContentLanguage = "Content-Language"
  58. HTTPHeaderDate = "Date"
  59. HTTPHeaderEtag = "ETag"
  60. HTTPHeaderExpires = "Expires"
  61. HTTPHeaderHost = "Host"
  62. HTTPHeaderLastModified = "Last-Modified"
  63. HTTPHeaderRange = "Range"
  64. HTTPHeaderLocation = "Location"
  65. HTTPHeaderOrigin = "Origin"
  66. HTTPHeaderServer = "Server"
  67. HTTPHeaderUserAgent = "User-Agent"
  68. HTTPHeaderIfModifiedSince = "If-Modified-Since"
  69. HTTPHeaderIfUnmodifiedSince = "If-Unmodified-Since"
  70. HTTPHeaderIfMatch = "If-Match"
  71. HTTPHeaderIfNoneMatch = "If-None-Match"
  72. HTTPHeaderOssACL = "X-Oss-Acl"
  73. HTTPHeaderOssMetaPrefix = "X-Oss-Meta-"
  74. HTTPHeaderOssObjectACL = "X-Oss-Object-Acl"
  75. HTTPHeaderOssSecurityToken = "X-Oss-Security-Token"
  76. HTTPHeaderOssServerSideEncryption = "X-Oss-Server-Side-Encryption"
  77. HTTPHeaderOssCopySource = "X-Oss-Copy-Source"
  78. HTTPHeaderOssCopySourceRange = "X-Oss-Copy-Source-Range"
  79. HTTPHeaderOssCopySourceIfMatch = "X-Oss-Copy-Source-If-Match"
  80. HTTPHeaderOssCopySourceIfNoneMatch = "X-Oss-Copy-Source-If-None-Match"
  81. HTTPHeaderOssCopySourceIfModifiedSince = "X-Oss-Copy-Source-If-Modified-Since"
  82. HTTPHeaderOssCopySourceIfUnmodifiedSince = "X-Oss-Copy-Source-If-Unmodified-Since"
  83. HTTPHeaderOssMetadataDirective = "X-Oss-Metadata-Directive"
  84. HTTPHeaderOssNextAppendPosition = "X-Oss-Next-Append-Position"
  85. HTTPHeaderOssRequestID = "X-Oss-Request-Id"
  86. HTTPHeaderOssCRC64 = "X-Oss-Hash-Crc64ecma"
  87. HTTPHeaderOssSymlinkTarget = "X-Oss-Symlink-Target"
  88. )
  89. // Http Param
  90. const (
  91. HTTPParamExpires = "Expires"
  92. HTTPParamAccessKeyID = "OSSAccessKeyId"
  93. HTTPParamSignature = "Signature"
  94. HTTPParamSecurityToken = "security-token"
  95. )
  96. // 其它常量
  97. const (
  98. MaxPartSize = 5 * 1024 * 1024 * 1024 // 文件片最大值,5GB
  99. MinPartSize = 100 * 1024 // 文件片最小值,100KBß
  100. FilePermMode = os.FileMode(0664) // 新建文件默认权限
  101. TempFilePrefix = "oss-go-temp-" // 临时文件前缀
  102. TempFileSuffix = ".temp" // 临时文件后缀
  103. CheckpointFileSuffix = ".cp" // Checkpoint文件后缀
  104. Version = "1.7.0" // Go sdk版本
  105. )