const.go 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  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. )
  45. // StorageClassType bucket storage type
  46. type StorageClassType string
  47. const (
  48. // StorageStandard standard
  49. StorageStandard StorageClassType = "Standard"
  50. // StorageIA infrequent access
  51. StorageIA StorageClassType = "IA"
  52. // StorageArchive archive
  53. StorageArchive StorageClassType = "Archive"
  54. )
  55. // RedundancyType bucket data Redundancy type
  56. type DataRedundancyType string
  57. const (
  58. // RedundancyLRS Local redundancy, default value
  59. RedundancyLRS DataRedundancyType = "LRS"
  60. // RedundancyZRS Same city redundancy
  61. RedundancyZRS DataRedundancyType = "ZRS"
  62. )
  63. // PayerType the type of request payer
  64. type PayerType string
  65. const (
  66. // Requester the requester who send the request
  67. Requester PayerType = "Requester"
  68. // BucketOwner the requester who send the request
  69. BucketOwner PayerType = "BucketOwner"
  70. )
  71. // HTTPMethod HTTP request method
  72. type HTTPMethod string
  73. const (
  74. // HTTPGet HTTP GET
  75. HTTPGet HTTPMethod = "GET"
  76. // HTTPPut HTTP PUT
  77. HTTPPut HTTPMethod = "PUT"
  78. // HTTPHead HTTP HEAD
  79. HTTPHead HTTPMethod = "HEAD"
  80. // HTTPPost HTTP POST
  81. HTTPPost HTTPMethod = "POST"
  82. // HTTPDelete HTTP DELETE
  83. HTTPDelete HTTPMethod = "DELETE"
  84. )
  85. // HTTP headers
  86. const (
  87. HTTPHeaderAcceptEncoding string = "Accept-Encoding"
  88. HTTPHeaderAuthorization = "Authorization"
  89. HTTPHeaderCacheControl = "Cache-Control"
  90. HTTPHeaderContentDisposition = "Content-Disposition"
  91. HTTPHeaderContentEncoding = "Content-Encoding"
  92. HTTPHeaderContentLength = "Content-Length"
  93. HTTPHeaderContentMD5 = "Content-MD5"
  94. HTTPHeaderContentType = "Content-Type"
  95. HTTPHeaderContentLanguage = "Content-Language"
  96. HTTPHeaderDate = "Date"
  97. HTTPHeaderEtag = "ETag"
  98. HTTPHeaderExpires = "Expires"
  99. HTTPHeaderHost = "Host"
  100. HTTPHeaderLastModified = "Last-Modified"
  101. HTTPHeaderRange = "Range"
  102. HTTPHeaderLocation = "Location"
  103. HTTPHeaderOrigin = "Origin"
  104. HTTPHeaderServer = "Server"
  105. HTTPHeaderUserAgent = "User-Agent"
  106. HTTPHeaderIfModifiedSince = "If-Modified-Since"
  107. HTTPHeaderIfUnmodifiedSince = "If-Unmodified-Since"
  108. HTTPHeaderIfMatch = "If-Match"
  109. HTTPHeaderIfNoneMatch = "If-None-Match"
  110. HTTPHeaderACReqMethod = "Access-Control-Request-Method"
  111. HTTPHeaderACReqHeaders = "Access-Control-Request-Headers"
  112. HTTPHeaderOssACL = "X-Oss-Acl"
  113. HTTPHeaderOssMetaPrefix = "X-Oss-Meta-"
  114. HTTPHeaderOssObjectACL = "X-Oss-Object-Acl"
  115. HTTPHeaderOssSecurityToken = "X-Oss-Security-Token"
  116. HTTPHeaderOssServerSideEncryption = "X-Oss-Server-Side-Encryption"
  117. HTTPHeaderOssServerSideEncryptionKeyID = "X-Oss-Server-Side-Encryption-Key-Id"
  118. HTTPHeaderOssCopySource = "X-Oss-Copy-Source"
  119. HTTPHeaderOssCopySourceRange = "X-Oss-Copy-Source-Range"
  120. HTTPHeaderOssCopySourceIfMatch = "X-Oss-Copy-Source-If-Match"
  121. HTTPHeaderOssCopySourceIfNoneMatch = "X-Oss-Copy-Source-If-None-Match"
  122. HTTPHeaderOssCopySourceIfModifiedSince = "X-Oss-Copy-Source-If-Modified-Since"
  123. HTTPHeaderOssCopySourceIfUnmodifiedSince = "X-Oss-Copy-Source-If-Unmodified-Since"
  124. HTTPHeaderOssMetadataDirective = "X-Oss-Metadata-Directive"
  125. HTTPHeaderOssNextAppendPosition = "X-Oss-Next-Append-Position"
  126. HTTPHeaderOssRequestID = "X-Oss-Request-Id"
  127. HTTPHeaderOssCRC64 = "X-Oss-Hash-Crc64ecma"
  128. HTTPHeaderOssSymlinkTarget = "X-Oss-Symlink-Target"
  129. HTTPHeaderOssStorageClass = "X-Oss-Storage-Class"
  130. HTTPHeaderOssCallback = "X-Oss-Callback"
  131. HTTPHeaderOssCallbackVar = "X-Oss-Callback-Var"
  132. HTTPHeaderOssRequester = "X-Oss-Request-Payer"
  133. HTTPHeaderOssTagging = "X-Oss-Tagging"
  134. HTTPHeaderOssTaggingDirective = "X-Oss-Tagging-Directive"
  135. HTTPHeaderOssTrafficLimit = "X-Oss-Traffic-Limit"
  136. HTTPHeaderOssForbidOverWrite = "X-Oss-Forbid-Overwrite"
  137. )
  138. // HTTP Param
  139. const (
  140. HTTPParamExpires = "Expires"
  141. HTTPParamAccessKeyID = "OSSAccessKeyId"
  142. HTTPParamSignature = "Signature"
  143. HTTPParamSecurityToken = "security-token"
  144. HTTPParamPlaylistName = "playlistName"
  145. )
  146. // Other constants
  147. const (
  148. MaxPartSize = 5 * 1024 * 1024 * 1024 // Max part size, 5GB
  149. MinPartSize = 100 * 1024 // Min part size, 100KB
  150. FilePermMode = os.FileMode(0664) // Default file permission
  151. TempFilePrefix = "oss-go-temp-" // Temp file prefix
  152. TempFileSuffix = ".temp" // Temp file suffix
  153. CheckpointFileSuffix = ".cp" // Checkpoint file suffix
  154. NullVersion = "null"
  155. Version = "v2.0.4" // Go SDK version
  156. )
  157. // FrameType
  158. const (
  159. DataFrameType = 8388609
  160. ContinuousFrameType = 8388612
  161. EndFrameType = 8388613
  162. MetaEndFrameCSVType = 8388614
  163. MetaEndFrameJSONType = 8388615
  164. )