const.go 6.0 KB

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