const.go 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  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. // MetadataDirectiveType specifying whether use the metadata of source object when copying object.
  16. type MetadataDirectiveType string
  17. const (
  18. // MetaCopy the target object's metadata is copied from the source one
  19. MetaCopy MetadataDirectiveType = "COPY"
  20. // MetaReplace the target object's metadata is created as part of the copy request (not same as the source one)
  21. MetaReplace MetadataDirectiveType = "REPLACE"
  22. )
  23. // TaggingDirectiveType specifying whether use the tagging of source object when copying object.
  24. type TaggingDirectiveType string
  25. const (
  26. // TaggingCopy the target object's tagging is copied from the source one
  27. TaggingCopy TaggingDirectiveType = "COPY"
  28. // TaggingReplace the target object's tagging is created as part of the copy request (not same as the source one)
  29. TaggingReplace TaggingDirectiveType = "REPLACE"
  30. )
  31. // AlgorithmType specifying the server side encryption algorithm name
  32. type AlgorithmType string
  33. const (
  34. KMSAlgorithm AlgorithmType = "KMS"
  35. AESAlgorithm AlgorithmType = "AES256"
  36. )
  37. // StorageClassType bucket storage type
  38. type StorageClassType string
  39. const (
  40. // StorageStandard standard
  41. StorageStandard StorageClassType = "Standard"
  42. // StorageIA infrequent access
  43. StorageIA StorageClassType = "IA"
  44. // StorageArchive archive
  45. StorageArchive StorageClassType = "Archive"
  46. )
  47. // PayerType the type of request payer
  48. type PayerType string
  49. const (
  50. // Requester the requester who send the request
  51. Requester PayerType = "requester"
  52. )
  53. // HTTPMethod HTTP request method
  54. type HTTPMethod string
  55. const (
  56. // HTTPGet HTTP GET
  57. HTTPGet HTTPMethod = "GET"
  58. // HTTPPut HTTP PUT
  59. HTTPPut HTTPMethod = "PUT"
  60. // HTTPHead HTTP HEAD
  61. HTTPHead HTTPMethod = "HEAD"
  62. // HTTPPost HTTP POST
  63. HTTPPost HTTPMethod = "POST"
  64. // HTTPDelete HTTP DELETE
  65. HTTPDelete HTTPMethod = "DELETE"
  66. )
  67. // HTTP headers
  68. const (
  69. HTTPHeaderAcceptEncoding string = "Accept-Encoding"
  70. HTTPHeaderAuthorization = "Authorization"
  71. HTTPHeaderCacheControl = "Cache-Control"
  72. HTTPHeaderContentDisposition = "Content-Disposition"
  73. HTTPHeaderContentEncoding = "Content-Encoding"
  74. HTTPHeaderContentLength = "Content-Length"
  75. HTTPHeaderContentMD5 = "Content-MD5"
  76. HTTPHeaderContentType = "Content-Type"
  77. HTTPHeaderContentLanguage = "Content-Language"
  78. HTTPHeaderDate = "Date"
  79. HTTPHeaderEtag = "ETag"
  80. HTTPHeaderExpires = "Expires"
  81. HTTPHeaderHost = "Host"
  82. HTTPHeaderLastModified = "Last-Modified"
  83. HTTPHeaderRange = "Range"
  84. HTTPHeaderLocation = "Location"
  85. HTTPHeaderOrigin = "Origin"
  86. HTTPHeaderServer = "Server"
  87. HTTPHeaderUserAgent = "User-Agent"
  88. HTTPHeaderIfModifiedSince = "If-Modified-Since"
  89. HTTPHeaderIfUnmodifiedSince = "If-Unmodified-Since"
  90. HTTPHeaderIfMatch = "If-Match"
  91. HTTPHeaderIfNoneMatch = "If-None-Match"
  92. HTTPHeaderOssACL = "X-Oss-Acl"
  93. HTTPHeaderOssMetaPrefix = "X-Oss-Meta-"
  94. HTTPHeaderOssObjectACL = "X-Oss-Object-Acl"
  95. HTTPHeaderOssSecurityToken = "X-Oss-Security-Token"
  96. HTTPHeaderOssServerSideEncryption = "X-Oss-Server-Side-Encryption"
  97. HTTPHeaderOssServerSideEncryptionKeyID = "X-Oss-Server-Side-Encryption-Key-Id"
  98. HTTPHeaderOssCopySource = "X-Oss-Copy-Source"
  99. HTTPHeaderOssCopySourceRange = "X-Oss-Copy-Source-Range"
  100. HTTPHeaderOssCopySourceIfMatch = "X-Oss-Copy-Source-If-Match"
  101. HTTPHeaderOssCopySourceIfNoneMatch = "X-Oss-Copy-Source-If-None-Match"
  102. HTTPHeaderOssCopySourceIfModifiedSince = "X-Oss-Copy-Source-If-Modified-Since"
  103. HTTPHeaderOssCopySourceIfUnmodifiedSince = "X-Oss-Copy-Source-If-Unmodified-Since"
  104. HTTPHeaderOssMetadataDirective = "X-Oss-Metadata-Directive"
  105. HTTPHeaderOssNextAppendPosition = "X-Oss-Next-Append-Position"
  106. HTTPHeaderOssRequestID = "X-Oss-Request-Id"
  107. HTTPHeaderOssCRC64 = "X-Oss-Hash-Crc64ecma"
  108. HTTPHeaderOssSymlinkTarget = "X-Oss-Symlink-Target"
  109. HTTPHeaderOssStorageClass = "X-Oss-Storage-Class"
  110. HTTPHeaderOssCallback = "X-Oss-Callback"
  111. HTTPHeaderOssCallbackVar = "X-Oss-Callback-Var"
  112. HTTPHeaderOssRequester = "X-Oss-Request-Payer"
  113. HTTPHeaderOssTagging = "X-Oss-Tagging"
  114. HTTPHeaderOssTaggingDirective = "X-Oss-Tagging-Directive"
  115. )
  116. // HTTP Param
  117. const (
  118. HTTPParamExpires = "Expires"
  119. HTTPParamAccessKeyID = "OSSAccessKeyId"
  120. HTTPParamSignature = "Signature"
  121. HTTPParamSecurityToken = "security-token"
  122. HTTPParamPlaylistName = "playlistName"
  123. )
  124. // Other constants
  125. const (
  126. MaxPartSize = 5 * 1024 * 1024 * 1024 // Max part size, 5GB
  127. MinPartSize = 100 * 1024 // Min part size, 100KB
  128. FilePermMode = os.FileMode(0664) // Default file permission
  129. TempFilePrefix = "oss-go-temp-" // Temp file prefix
  130. TempFileSuffix = ".temp" // Temp file suffix
  131. CheckpointFileSuffix = ".cp" // Checkpoint file suffix
  132. Version = "v1.9.6" // Go SDK version
  133. )