const.go 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  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. // HTTP headers
  54. const (
  55. HTTPHeaderAcceptEncoding string = "Accept-Encoding"
  56. HTTPHeaderAuthorization = "Authorization"
  57. HTTPHeaderCacheControl = "Cache-Control"
  58. HTTPHeaderContentDisposition = "Content-Disposition"
  59. HTTPHeaderContentEncoding = "Content-Encoding"
  60. HTTPHeaderContentLength = "Content-Length"
  61. HTTPHeaderContentMD5 = "Content-MD5"
  62. HTTPHeaderContentType = "Content-Type"
  63. HTTPHeaderContentLanguage = "Content-Language"
  64. HTTPHeaderDate = "Date"
  65. HTTPHeaderEtag = "ETag"
  66. HTTPHeaderExpires = "Expires"
  67. HTTPHeaderHost = "Host"
  68. HTTPHeaderLastModified = "Last-Modified"
  69. HTTPHeaderRange = "Range"
  70. HTTPHeaderLocation = "Location"
  71. HTTPHeaderOrigin = "Origin"
  72. HTTPHeaderServer = "Server"
  73. HTTPHeaderUserAgent = "User-Agent"
  74. HTTPHeaderIfModifiedSince = "If-Modified-Since"
  75. HTTPHeaderIfUnmodifiedSince = "If-Unmodified-Since"
  76. HTTPHeaderIfMatch = "If-Match"
  77. HTTPHeaderIfNoneMatch = "If-None-Match"
  78. HTTPHeaderOssACL = "X-Oss-Acl"
  79. HTTPHeaderOssMetaPrefix = "X-Oss-Meta-"
  80. HTTPHeaderOssObjectACL = "X-Oss-Object-Acl"
  81. HTTPHeaderOssSecurityToken = "X-Oss-Security-Token"
  82. HTTPHeaderOssServerSideEncryption = "X-Oss-Server-Side-Encryption"
  83. HTTPHeaderOssCopySource = "X-Oss-Copy-Source"
  84. HTTPHeaderOssCopySourceRange = "X-Oss-Copy-Source-Range"
  85. HTTPHeaderOssCopySourceIfMatch = "X-Oss-Copy-Source-If-Match"
  86. HTTPHeaderOssCopySourceIfNoneMatch = "X-Oss-Copy-Source-If-None-Match"
  87. HTTPHeaderOssCopySourceIfModifiedSince = "X-Oss-Copy-Source-If-Modified-Since"
  88. HTTPHeaderOssCopySourceIfUnmodifiedSince = "X-Oss-Copy-Source-If-Unmodified-Since"
  89. HTTPHeaderOssMetadataDirective = "X-Oss-Metadata-Directive"
  90. HTTPHeaderOssNextAppendPosition = "X-Oss-Next-Append-Position"
  91. HTTPHeaderOssRequestID = "X-Oss-Request-Id"
  92. HTTPHeaderOssCRC64 = "X-Oss-Hash-Crc64ecma"
  93. HTTPHeaderOssSymlinkTarget = "X-Oss-Symlink-Target"
  94. HTTPHeaderOssStorageClass = "X-Oss-Storage-Class"
  95. HTTPHeaderOssCallback = "X-Oss-Callback"
  96. HTTPHeaderOssCallbackVar = "X-Oss-Callback-Var"
  97. HTTPHeaderOSSRequester = "X-Oss-Request-Payer"
  98. )
  99. // HTTP Param
  100. const (
  101. HTTPParamExpires = "Expires"
  102. HTTPParamAccessKeyID = "OSSAccessKeyId"
  103. HTTPParamSignature = "Signature"
  104. HTTPParamSecurityToken = "security-token"
  105. )
  106. // Other constants
  107. const (
  108. MaxPartSize = 5 * 1024 * 1024 * 1024 // Max part size, 5GB
  109. MinPartSize = 100 * 1024 // Min part size, 100KB
  110. FilePermMode = os.FileMode(0664) // Default file permission
  111. TempFilePrefix = "oss-go-temp-" // Temp file prefix
  112. TempFileSuffix = ".temp" // Temp file suffix
  113. CheckpointFileSuffix = ".cp" // Checkpoint file suffix
  114. Version = "1.9.1" // Go SDK version
  115. )