const.go 5.5 KB

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