const.go 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  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. // StorageClassType bucket storage type
  24. type StorageClassType string
  25. const (
  26. // StorageStandard standard
  27. StorageStandard StorageClassType = "Standard"
  28. // StorageIA infrequent access
  29. StorageIA StorageClassType = "IA"
  30. // StorageArchive archive
  31. StorageArchive StorageClassType = "Archive"
  32. )
  33. // PayerType the type of request payer
  34. type PayerType string
  35. const (
  36. // Requester the requester who send the request
  37. Requester PayerType = "requester"
  38. )
  39. // HTTPMethod HTTP request method
  40. type HTTPMethod string
  41. const (
  42. // HTTPGet HTTP GET
  43. HTTPGet HTTPMethod = "GET"
  44. // HTTPPut HTTP PUT
  45. HTTPPut HTTPMethod = "PUT"
  46. // HTTPHead HTTP HEAD
  47. HTTPHead HTTPMethod = "HEAD"
  48. // HTTPPost HTTP POST
  49. HTTPPost HTTPMethod = "POST"
  50. // HTTPDelete HTTP DELETE
  51. HTTPDelete HTTPMethod = "DELETE"
  52. )
  53. // LifecycleRuleType rule type of lifecycle
  54. type LifecycleRuleType string
  55. const (
  56. // LRTExpriration Expriation
  57. LRTExpriration LifecycleRuleType = "Expriation"
  58. // LRTTransition Transition
  59. LRTTransition LifecycleRuleType = "Transition"
  60. // LRTAbortMultiPartUpload AbortMultiPartUpload
  61. LRTAbortMultiPartUpload LifecycleRuleType = "AbortMultiPartUpload"
  62. )
  63. // HTTP headers
  64. const (
  65. HTTPHeaderAcceptEncoding string = "Accept-Encoding"
  66. HTTPHeaderAuthorization = "Authorization"
  67. HTTPHeaderCacheControl = "Cache-Control"
  68. HTTPHeaderContentDisposition = "Content-Disposition"
  69. HTTPHeaderContentEncoding = "Content-Encoding"
  70. HTTPHeaderContentLength = "Content-Length"
  71. HTTPHeaderContentMD5 = "Content-MD5"
  72. HTTPHeaderContentType = "Content-Type"
  73. HTTPHeaderContentLanguage = "Content-Language"
  74. HTTPHeaderDate = "Date"
  75. HTTPHeaderEtag = "ETag"
  76. HTTPHeaderExpires = "Expires"
  77. HTTPHeaderHost = "Host"
  78. HTTPHeaderLastModified = "Last-Modified"
  79. HTTPHeaderRange = "Range"
  80. HTTPHeaderLocation = "Location"
  81. HTTPHeaderOrigin = "Origin"
  82. HTTPHeaderServer = "Server"
  83. HTTPHeaderUserAgent = "User-Agent"
  84. HTTPHeaderIfModifiedSince = "If-Modified-Since"
  85. HTTPHeaderIfUnmodifiedSince = "If-Unmodified-Since"
  86. HTTPHeaderIfMatch = "If-Match"
  87. HTTPHeaderIfNoneMatch = "If-None-Match"
  88. HTTPHeaderOssACL = "X-Oss-Acl"
  89. HTTPHeaderOssMetaPrefix = "X-Oss-Meta-"
  90. HTTPHeaderOssObjectACL = "X-Oss-Object-Acl"
  91. HTTPHeaderOssSecurityToken = "X-Oss-Security-Token"
  92. HTTPHeaderOssServerSideEncryption = "X-Oss-Server-Side-Encryption"
  93. HTTPHeaderOssServerSideEncryptionKeyID = "X-Oss-Server-Side-Encryption-Key-Id"
  94. HTTPHeaderOssCopySource = "X-Oss-Copy-Source"
  95. HTTPHeaderOssCopySourceRange = "X-Oss-Copy-Source-Range"
  96. HTTPHeaderOssCopySourceIfMatch = "X-Oss-Copy-Source-If-Match"
  97. HTTPHeaderOssCopySourceIfNoneMatch = "X-Oss-Copy-Source-If-None-Match"
  98. HTTPHeaderOssCopySourceIfModifiedSince = "X-Oss-Copy-Source-If-Modified-Since"
  99. HTTPHeaderOssCopySourceIfUnmodifiedSince = "X-Oss-Copy-Source-If-Unmodified-Since"
  100. HTTPHeaderOssMetadataDirective = "X-Oss-Metadata-Directive"
  101. HTTPHeaderOssNextAppendPosition = "X-Oss-Next-Append-Position"
  102. HTTPHeaderOssRequestID = "X-Oss-Request-Id"
  103. HTTPHeaderOssCRC64 = "X-Oss-Hash-Crc64ecma"
  104. HTTPHeaderOssSymlinkTarget = "X-Oss-Symlink-Target"
  105. HTTPHeaderOssStorageClass = "X-Oss-Storage-Class"
  106. HTTPHeaderOssCallback = "X-Oss-Callback"
  107. HTTPHeaderOssCallbackVar = "X-Oss-Callback-Var"
  108. HTTPHeaderOSSRequester = "X-Oss-Request-Payer"
  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. )