const.go 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. package oss
  2. import "os"
  3. // ACLType bucket/object ACL
  4. type ACLType string
  5. const (
  6. // ACLPrivate definition : private read and write
  7. ACLPrivate ACLType = "private"
  8. // ACLPublicRead definition : public read and private write
  9. ACLPublicRead ACLType = "public-read"
  10. // ACLPublicReadWrite definition : public read and public write
  11. ACLPublicReadWrite ACLType = "public-read-write"
  12. // ACLDefault Object. It's only applicable for object.
  13. ACLDefault ACLType = "default"
  14. )
  15. // bucket versioning status
  16. type VersioningStatus string
  17. const (
  18. // Versioning Status definition: Enabled
  19. VersionEnabled VersioningStatus = "Enabled"
  20. // Versioning Status definition: Suspended
  21. VersionSuspended VersioningStatus = "Suspended"
  22. )
  23. // MetadataDirectiveType specifying whether use the metadata of source object when copying object.
  24. type MetadataDirectiveType string
  25. const (
  26. // MetaCopy the target object's metadata is copied from the source one
  27. MetaCopy MetadataDirectiveType = "COPY"
  28. // MetaReplace the target object's metadata is created as part of the copy request (not same as the source one)
  29. MetaReplace MetadataDirectiveType = "REPLACE"
  30. )
  31. // TaggingDirectiveType specifying whether use the tagging of source object when copying object.
  32. type TaggingDirectiveType string
  33. const (
  34. // TaggingCopy the target object's tagging is copied from the source one
  35. TaggingCopy TaggingDirectiveType = "COPY"
  36. // TaggingReplace the target object's tagging is created as part of the copy request (not same as the source one)
  37. TaggingReplace TaggingDirectiveType = "REPLACE"
  38. )
  39. // AlgorithmType specifying the server side encryption algorithm name
  40. type AlgorithmType string
  41. const (
  42. KMSAlgorithm AlgorithmType = "KMS"
  43. AESAlgorithm AlgorithmType = "AES256"
  44. SM4Algorithm AlgorithmType = "SM4"
  45. )
  46. // StorageClassType bucket storage type
  47. type StorageClassType string
  48. const (
  49. // StorageStandard standard
  50. StorageStandard StorageClassType = "Standard"
  51. // StorageIA infrequent access
  52. StorageIA StorageClassType = "IA"
  53. // StorageArchive archive
  54. StorageArchive StorageClassType = "Archive"
  55. // StorageColdArchive cold archive
  56. StorageColdArchive StorageClassType = "ColdArchive"
  57. )
  58. //RedundancyType bucket data Redundancy type
  59. type DataRedundancyType string
  60. const (
  61. // RedundancyLRS Local redundancy, default value
  62. RedundancyLRS DataRedundancyType = "LRS"
  63. // RedundancyZRS Same city redundancy
  64. RedundancyZRS DataRedundancyType = "ZRS"
  65. )
  66. // PayerType the type of request payer
  67. type PayerType string
  68. const (
  69. // Requester the requester who send the request
  70. Requester PayerType = "Requester"
  71. // BucketOwner the requester who send the request
  72. BucketOwner PayerType = "BucketOwner"
  73. )
  74. //RestoreMode the restore mode for coldArchive object
  75. type RestoreMode string
  76. const (
  77. //RestoreExpedited object will be restored in 1 hour
  78. RestoreExpedited RestoreMode = "Expedited"
  79. //RestoreStandard object will be restored in 2-5 hours
  80. RestoreStandard RestoreMode = "Standard"
  81. //RestoreBulk object will be restored in 5-10 hours
  82. RestoreBulk RestoreMode = "Bulk"
  83. )
  84. // HTTPMethod HTTP request method
  85. type HTTPMethod string
  86. const (
  87. // HTTPGet HTTP GET
  88. HTTPGet HTTPMethod = "GET"
  89. // HTTPPut HTTP PUT
  90. HTTPPut HTTPMethod = "PUT"
  91. // HTTPHead HTTP HEAD
  92. HTTPHead HTTPMethod = "HEAD"
  93. // HTTPPost HTTP POST
  94. HTTPPost HTTPMethod = "POST"
  95. // HTTPDelete HTTP DELETE
  96. HTTPDelete HTTPMethod = "DELETE"
  97. )
  98. // HTTP headers
  99. const (
  100. HTTPHeaderAcceptEncoding string = "Accept-Encoding"
  101. HTTPHeaderAuthorization = "Authorization"
  102. HTTPHeaderCacheControl = "Cache-Control"
  103. HTTPHeaderContentDisposition = "Content-Disposition"
  104. HTTPHeaderContentEncoding = "Content-Encoding"
  105. HTTPHeaderContentLength = "Content-Length"
  106. HTTPHeaderContentMD5 = "Content-MD5"
  107. HTTPHeaderContentType = "Content-Type"
  108. HTTPHeaderContentLanguage = "Content-Language"
  109. HTTPHeaderDate = "Date"
  110. HTTPHeaderEtag = "ETag"
  111. HTTPHeaderExpires = "Expires"
  112. HTTPHeaderHost = "Host"
  113. HTTPHeaderLastModified = "Last-Modified"
  114. HTTPHeaderRange = "Range"
  115. HTTPHeaderLocation = "Location"
  116. HTTPHeaderOrigin = "Origin"
  117. HTTPHeaderServer = "Server"
  118. HTTPHeaderUserAgent = "User-Agent"
  119. HTTPHeaderIfModifiedSince = "If-Modified-Since"
  120. HTTPHeaderIfUnmodifiedSince = "If-Unmodified-Since"
  121. HTTPHeaderIfMatch = "If-Match"
  122. HTTPHeaderIfNoneMatch = "If-None-Match"
  123. HTTPHeaderACReqMethod = "Access-Control-Request-Method"
  124. HTTPHeaderACReqHeaders = "Access-Control-Request-Headers"
  125. HTTPHeaderOssACL = "X-Oss-Acl"
  126. HTTPHeaderOssMetaPrefix = "X-Oss-Meta-"
  127. HTTPHeaderOssObjectACL = "X-Oss-Object-Acl"
  128. HTTPHeaderOssSecurityToken = "X-Oss-Security-Token"
  129. HTTPHeaderOssServerSideEncryption = "X-Oss-Server-Side-Encryption"
  130. HTTPHeaderOssServerSideEncryptionKeyID = "X-Oss-Server-Side-Encryption-Key-Id"
  131. HTTPHeaderOssServerSideDataEncryption = "X-Oss-Server-Side-Data-Encryption"
  132. HTTPHeaderSSECAlgorithm = "X-Oss-Server-Side-Encryption-Customer-Algorithm"
  133. HTTPHeaderSSECKey = "X-Oss-Server-Side-Encryption-Customer-Key"
  134. HTTPHeaderSSECKeyMd5 = "X-Oss-Server-Side-Encryption-Customer-Key-MD5"
  135. HTTPHeaderOssCopySource = "X-Oss-Copy-Source"
  136. HTTPHeaderOssCopySourceRange = "X-Oss-Copy-Source-Range"
  137. HTTPHeaderOssCopySourceIfMatch = "X-Oss-Copy-Source-If-Match"
  138. HTTPHeaderOssCopySourceIfNoneMatch = "X-Oss-Copy-Source-If-None-Match"
  139. HTTPHeaderOssCopySourceIfModifiedSince = "X-Oss-Copy-Source-If-Modified-Since"
  140. HTTPHeaderOssCopySourceIfUnmodifiedSince = "X-Oss-Copy-Source-If-Unmodified-Since"
  141. HTTPHeaderOssMetadataDirective = "X-Oss-Metadata-Directive"
  142. HTTPHeaderOssNextAppendPosition = "X-Oss-Next-Append-Position"
  143. HTTPHeaderOssRequestID = "X-Oss-Request-Id"
  144. HTTPHeaderOssCRC64 = "X-Oss-Hash-Crc64ecma"
  145. HTTPHeaderOssSymlinkTarget = "X-Oss-Symlink-Target"
  146. HTTPHeaderOssStorageClass = "X-Oss-Storage-Class"
  147. HTTPHeaderOssCallback = "X-Oss-Callback"
  148. HTTPHeaderOssCallbackVar = "X-Oss-Callback-Var"
  149. HTTPHeaderOssRequester = "X-Oss-Request-Payer"
  150. HTTPHeaderOssTagging = "X-Oss-Tagging"
  151. HTTPHeaderOssTaggingDirective = "X-Oss-Tagging-Directive"
  152. HTTPHeaderOssTrafficLimit = "X-Oss-Traffic-Limit"
  153. HTTPHeaderOssForbidOverWrite = "X-Oss-Forbid-Overwrite"
  154. HTTPHeaderOssRangeBehavior = "X-Oss-Range-Behavior"
  155. HTTPHeaderOssTaskID = "X-Oss-Task-Id"
  156. )
  157. // HTTP Param
  158. const (
  159. HTTPParamExpires = "Expires"
  160. HTTPParamAccessKeyID = "OSSAccessKeyId"
  161. HTTPParamSignature = "Signature"
  162. HTTPParamSecurityToken = "security-token"
  163. HTTPParamPlaylistName = "playlistName"
  164. HTTPParamSignatureVersion = "x-oss-signature-version"
  165. HTTPParamExpiresV2 = "x-oss-expires"
  166. HTTPParamAccessKeyIDV2 = "x-oss-access-key-id"
  167. HTTPParamSignatureV2 = "x-oss-signature"
  168. HTTPParamAdditionalHeadersV2 = "x-oss-additional-headers"
  169. )
  170. // Other constants
  171. const (
  172. MaxPartSize = 5 * 1024 * 1024 * 1024 // Max part size, 5GB
  173. MinPartSize = 100 * 1024 // Min part size, 100KB
  174. FilePermMode = os.FileMode(0664) // Default file permission
  175. TempFilePrefix = "oss-go-temp-" // Temp file prefix
  176. TempFileSuffix = ".temp" // Temp file suffix
  177. CheckpointFileSuffix = ".cp" // Checkpoint file suffix
  178. NullVersion = "null"
  179. Version = "v2.1.4" // Go SDK version
  180. )
  181. // FrameType
  182. const (
  183. DataFrameType = 8388609
  184. ContinuousFrameType = 8388612
  185. EndFrameType = 8388613
  186. MetaEndFrameCSVType = 8388614
  187. MetaEndFrameJSONType = 8388615
  188. )
  189. // AuthVersion the version of auth
  190. type AuthVersionType string
  191. const (
  192. // AuthV1 v1
  193. AuthV1 AuthVersionType = "v1"
  194. // AuthV2 v2
  195. AuthV2 AuthVersionType = "v2"
  196. )