const.go 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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. HTTPHeaderOssServerSideEncryptionKeyID = "X-Oss-Server-Side-Encryption-Key-Id"
  84. HTTPHeaderOssCopySource = "X-Oss-Copy-Source"
  85. HTTPHeaderOssCopySourceRange = "X-Oss-Copy-Source-Range"
  86. HTTPHeaderOssCopySourceIfMatch = "X-Oss-Copy-Source-If-Match"
  87. HTTPHeaderOssCopySourceIfNoneMatch = "X-Oss-Copy-Source-If-None-Match"
  88. HTTPHeaderOssCopySourceIfModifiedSince = "X-Oss-Copy-Source-If-Modified-Since"
  89. HTTPHeaderOssCopySourceIfUnmodifiedSince = "X-Oss-Copy-Source-If-Unmodified-Since"
  90. HTTPHeaderOssMetadataDirective = "X-Oss-Metadata-Directive"
  91. HTTPHeaderOssNextAppendPosition = "X-Oss-Next-Append-Position"
  92. HTTPHeaderOssRequestID = "X-Oss-Request-Id"
  93. HTTPHeaderOssCRC64 = "X-Oss-Hash-Crc64ecma"
  94. HTTPHeaderOssSymlinkTarget = "X-Oss-Symlink-Target"
  95. HTTPHeaderOssStorageClass = "X-Oss-Storage-Class"
  96. HTTPHeaderOssCallback = "X-Oss-Callback"
  97. HTTPHeaderOssCallbackVar = "X-Oss-Callback-Var"
  98. HTTPHeaderOSSRequester = "X-Oss-Request-Payer"
  99. )
  100. // HTTP Param
  101. const (
  102. HTTPParamExpires = "Expires"
  103. HTTPParamAccessKeyID = "OSSAccessKeyId"
  104. HTTPParamSignature = "Signature"
  105. HTTPParamSecurityToken = "security-token"
  106. HTTPParamPlaylistName = "playlistName"
  107. )
  108. // Other constants
  109. const (
  110. MaxPartSize = 5 * 1024 * 1024 * 1024 // Max part size, 5GB
  111. MinPartSize = 100 * 1024 // Min part size, 100KB
  112. FilePermMode = os.FileMode(0664) // Default file permission
  113. TempFilePrefix = "oss-go-temp-" // Temp file prefix
  114. TempFileSuffix = ".temp" // Temp file suffix
  115. CheckpointFileSuffix = ".cp" // Checkpoint file suffix
  116. Version = "1.9.2" // Go SDK version
  117. )