1package oss 2 3import "os" 4 5// ACLType bucket/object ACL 6type ACLType string 7 8const ( 9 // ACLPrivate definition : private read and write 10 ACLPrivate ACLType = "private" 11 12 // ACLPublicRead definition : public read and private write 13 ACLPublicRead ACLType = "public-read" 14 15 // ACLPublicReadWrite definition : public read and public write 16 ACLPublicReadWrite ACLType = "public-read-write" 17 18 // ACLDefault Object. It's only applicable for object. 19 ACLDefault ACLType = "default" 20) 21 22// MetadataDirectiveType specifying whether use the metadata of source object when copying object. 23type MetadataDirectiveType string 24 25const ( 26 // MetaCopy the target object's metadata is copied from the source one 27 MetaCopy MetadataDirectiveType = "COPY" 28 29 // MetaReplace the target object's metadata is created as part of the copy request (not same as the source one) 30 MetaReplace MetadataDirectiveType = "REPLACE" 31) 32 33// StorageClassType bucket storage type 34type StorageClassType string 35 36const ( 37 // StorageStandard standard 38 StorageStandard StorageClassType = "Standard" 39 40 // StorageIA infrequent access 41 StorageIA StorageClassType = "IA" 42 43 // StorageArchive archive 44 StorageArchive StorageClassType = "Archive" 45) 46 47// PayerType the type of request payer 48type PayerType string 49 50const ( 51 // Requester the requester who send the request 52 Requester PayerType = "requester" 53) 54 55// HTTPMethod HTTP request method 56type HTTPMethod string 57 58const ( 59 // HTTPGet HTTP GET 60 HTTPGet HTTPMethod = "GET" 61 62 // HTTPPut HTTP PUT 63 HTTPPut HTTPMethod = "PUT" 64 65 // HTTPHead HTTP HEAD 66 HTTPHead HTTPMethod = "HEAD" 67 68 // HTTPPost HTTP POST 69 HTTPPost HTTPMethod = "POST" 70 71 // HTTPDelete HTTP DELETE 72 HTTPDelete HTTPMethod = "DELETE" 73) 74 75// HTTP headers 76const ( 77 HTTPHeaderAcceptEncoding string = "Accept-Encoding" 78 HTTPHeaderAuthorization = "Authorization" 79 HTTPHeaderCacheControl = "Cache-Control" 80 HTTPHeaderContentDisposition = "Content-Disposition" 81 HTTPHeaderContentEncoding = "Content-Encoding" 82 HTTPHeaderContentLength = "Content-Length" 83 HTTPHeaderContentMD5 = "Content-MD5" 84 HTTPHeaderContentType = "Content-Type" 85 HTTPHeaderContentLanguage = "Content-Language" 86 HTTPHeaderDate = "Date" 87 HTTPHeaderEtag = "ETag" 88 HTTPHeaderExpires = "Expires" 89 HTTPHeaderHost = "Host" 90 HTTPHeaderLastModified = "Last-Modified" 91 HTTPHeaderRange = "Range" 92 HTTPHeaderLocation = "Location" 93 HTTPHeaderOrigin = "Origin" 94 HTTPHeaderServer = "Server" 95 HTTPHeaderUserAgent = "User-Agent" 96 HTTPHeaderIfModifiedSince = "If-Modified-Since" 97 HTTPHeaderIfUnmodifiedSince = "If-Unmodified-Since" 98 HTTPHeaderIfMatch = "If-Match" 99 HTTPHeaderIfNoneMatch = "If-None-Match" 100 101 HTTPHeaderOssACL = "X-Oss-Acl" 102 HTTPHeaderOssMetaPrefix = "X-Oss-Meta-" 103 HTTPHeaderOssObjectACL = "X-Oss-Object-Acl" 104 HTTPHeaderOssSecurityToken = "X-Oss-Security-Token" 105 HTTPHeaderOssServerSideEncryption = "X-Oss-Server-Side-Encryption" 106 HTTPHeaderOssServerSideEncryptionKeyID = "X-Oss-Server-Side-Encryption-Key-Id" 107 HTTPHeaderOssCopySource = "X-Oss-Copy-Source" 108 HTTPHeaderOssCopySourceRange = "X-Oss-Copy-Source-Range" 109 HTTPHeaderOssCopySourceIfMatch = "X-Oss-Copy-Source-If-Match" 110 HTTPHeaderOssCopySourceIfNoneMatch = "X-Oss-Copy-Source-If-None-Match" 111 HTTPHeaderOssCopySourceIfModifiedSince = "X-Oss-Copy-Source-If-Modified-Since" 112 HTTPHeaderOssCopySourceIfUnmodifiedSince = "X-Oss-Copy-Source-If-Unmodified-Since" 113 HTTPHeaderOssMetadataDirective = "X-Oss-Metadata-Directive" 114 HTTPHeaderOssNextAppendPosition = "X-Oss-Next-Append-Position" 115 HTTPHeaderOssRequestID = "X-Oss-Request-Id" 116 HTTPHeaderOssCRC64 = "X-Oss-Hash-Crc64ecma" 117 HTTPHeaderOssSymlinkTarget = "X-Oss-Symlink-Target" 118 HTTPHeaderOssStorageClass = "X-Oss-Storage-Class" 119 HTTPHeaderOssCallback = "X-Oss-Callback" 120 HTTPHeaderOssCallbackVar = "X-Oss-Callback-Var" 121 HTTPHeaderOSSRequester = "X-Oss-Request-Payer" 122) 123 124// HTTP Param 125const ( 126 HTTPParamExpires = "Expires" 127 HTTPParamAccessKeyID = "OSSAccessKeyId" 128 HTTPParamSignature = "Signature" 129 HTTPParamSecurityToken = "security-token" 130 HTTPParamPlaylistName = "playlistName" 131) 132 133// Other constants 134const ( 135 MaxPartSize = 5 * 1024 * 1024 * 1024 // Max part size, 5GB 136 MinPartSize = 100 * 1024 // Min part size, 100KB 137 138 FilePermMode = os.FileMode(0664) // Default file permission 139 140 TempFilePrefix = "oss-go-temp-" // Temp file prefix 141 TempFileSuffix = ".temp" // Temp file suffix 142 143 CheckpointFileSuffix = ".cp" // Checkpoint file suffix 144 145 Version = "1.9.5" // Go SDK version 146) 147