const.go 5.3 KB

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