const.go 6.4 KB

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