github.com/huaweicloud/golangsdk@v0.0.0-20210831081626-d823fe11ceba/openstack/obs/const.go (about)

     1  // Copyright 2019 Huawei Technologies Co.,Ltd.
     2  // Licensed under the Apache License, Version 2.0 (the "License"); you may not use
     3  // this file except in compliance with the License.  You may obtain a copy of the
     4  // License at
     5  //
     6  // http://www.apache.org/licenses/LICENSE-2.0
     7  //
     8  // Unless required by applicable law or agreed to in writing, software distributed
     9  // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
    10  // CONDITIONS OF ANY KIND, either express or implied.  See the License for the
    11  // specific language governing permissions and limitations under the License.
    12  
    13  package obs
    14  
    15  const (
    16  	obsSdkVersion          = "3.21.1"
    17  	USER_AGENT             = "obs-sdk-go/" + obsSdkVersion
    18  	HEADER_PREFIX          = "x-amz-"
    19  	HEADER_PREFIX_META     = "x-amz-meta-"
    20  	HEADER_PREFIX_OBS      = "x-obs-"
    21  	HEADER_PREFIX_META_OBS = "x-obs-meta-"
    22  	HEADER_DATE_AMZ        = "x-amz-date"
    23  	HEADER_DATE_OBS        = "x-obs-date"
    24  	HEADER_STS_TOKEN_AMZ   = "x-amz-security-token"
    25  	HEADER_STS_TOKEN_OBS   = "x-obs-security-token"
    26  	HEADER_ACCESSS_KEY_AMZ = "AWSAccessKeyId"
    27  	PREFIX_META            = "meta-"
    28  
    29  	HEADER_CONTENT_SHA256_AMZ               = "x-amz-content-sha256"
    30  	HEADER_ACL_AMZ                          = "x-amz-acl"
    31  	HEADER_ACL_OBS                          = "x-obs-acl"
    32  	HEADER_ACL                              = "acl"
    33  	HEADER_LOCATION_AMZ                     = "location"
    34  	HEADER_BUCKET_LOCATION_OBS              = "bucket-location"
    35  	HEADER_COPY_SOURCE                      = "copy-source"
    36  	HEADER_COPY_SOURCE_RANGE                = "copy-source-range"
    37  	HEADER_RANGE                            = "Range"
    38  	HEADER_STORAGE_CLASS                    = "x-default-storage-class"
    39  	HEADER_STORAGE_CLASS_OBS                = "x-obs-storage-class"
    40  	HEADER_VERSION_OBS                      = "version"
    41  	HEADER_GRANT_READ_OBS                   = "grant-read"
    42  	HEADER_GRANT_WRITE_OBS                  = "grant-write"
    43  	HEADER_GRANT_READ_ACP_OBS               = "grant-read-acp"
    44  	HEADER_GRANT_WRITE_ACP_OBS              = "grant-write-acp"
    45  	HEADER_GRANT_FULL_CONTROL_OBS           = "grant-full-control"
    46  	HEADER_GRANT_READ_DELIVERED_OBS         = "grant-read-delivered"
    47  	HEADER_GRANT_FULL_CONTROL_DELIVERED_OBS = "grant-full-control-delivered"
    48  	HEADER_REQUEST_ID                       = "request-id"
    49  	HEADER_BUCKET_REGION                    = "bucket-region"
    50  	HEADER_ACCESS_CONRTOL_ALLOW_ORIGIN      = "access-control-allow-origin"
    51  	HEADER_ACCESS_CONRTOL_ALLOW_HEADERS     = "access-control-allow-headers"
    52  	HEADER_ACCESS_CONRTOL_MAX_AGE           = "access-control-max-age"
    53  	HEADER_ACCESS_CONRTOL_ALLOW_METHODS     = "access-control-allow-methods"
    54  	HEADER_ACCESS_CONRTOL_EXPOSE_HEADERS    = "access-control-expose-headers"
    55  	HEADER_EPID_HEADERS                     = "epid"
    56  	HEADER_VERSION_ID                       = "version-id"
    57  	HEADER_COPY_SOURCE_VERSION_ID           = "copy-source-version-id"
    58  	HEADER_DELETE_MARKER                    = "delete-marker"
    59  	HEADER_WEBSITE_REDIRECT_LOCATION        = "website-redirect-location"
    60  	HEADER_METADATA_DIRECTIVE               = "metadata-directive"
    61  	HEADER_EXPIRATION                       = "expiration"
    62  	HEADER_EXPIRES_OBS                      = "x-obs-expires"
    63  	HEADER_RESTORE                          = "restore"
    64  	HEADER_OBJECT_TYPE                      = "object-type"
    65  	HEADER_NEXT_APPEND_POSITION             = "next-append-position"
    66  	HEADER_STORAGE_CLASS2                   = "storage-class"
    67  	HEADER_CONTENT_LENGTH                   = "content-length"
    68  	HEADER_CONTENT_TYPE                     = "content-type"
    69  	HEADER_CONTENT_LANGUAGE                 = "content-language"
    70  	HEADER_EXPIRES                          = "expires"
    71  	HEADER_CACHE_CONTROL                    = "cache-control"
    72  	HEADER_CONTENT_DISPOSITION              = "content-disposition"
    73  	HEADER_CONTENT_ENCODING                 = "content-encoding"
    74  	HEADER_AZ_REDUNDANCY                    = "az-redundancy"
    75  	headerOefMarker                         = "oef-marker"
    76  
    77  	HEADER_ETAG         = "etag"
    78  	HEADER_LASTMODIFIED = "last-modified"
    79  
    80  	HEADER_COPY_SOURCE_IF_MATCH            = "copy-source-if-match"
    81  	HEADER_COPY_SOURCE_IF_NONE_MATCH       = "copy-source-if-none-match"
    82  	HEADER_COPY_SOURCE_IF_MODIFIED_SINCE   = "copy-source-if-modified-since"
    83  	HEADER_COPY_SOURCE_IF_UNMODIFIED_SINCE = "copy-source-if-unmodified-since"
    84  
    85  	HEADER_IF_MATCH            = "If-Match"
    86  	HEADER_IF_NONE_MATCH       = "If-None-Match"
    87  	HEADER_IF_MODIFIED_SINCE   = "If-Modified-Since"
    88  	HEADER_IF_UNMODIFIED_SINCE = "If-Unmodified-Since"
    89  
    90  	HEADER_SSEC_ENCRYPTION = "server-side-encryption-customer-algorithm"
    91  	HEADER_SSEC_KEY        = "server-side-encryption-customer-key"
    92  	HEADER_SSEC_KEY_MD5    = "server-side-encryption-customer-key-MD5"
    93  
    94  	HEADER_SSEKMS_ENCRYPTION      = "server-side-encryption"
    95  	HEADER_SSEKMS_KEY             = "server-side-encryption-aws-kms-key-id"
    96  	HEADER_SSEKMS_ENCRYPT_KEY_OBS = "server-side-encryption-kms-key-id"
    97  
    98  	HEADER_SSEC_COPY_SOURCE_ENCRYPTION = "copy-source-server-side-encryption-customer-algorithm"
    99  	HEADER_SSEC_COPY_SOURCE_KEY        = "copy-source-server-side-encryption-customer-key"
   100  	HEADER_SSEC_COPY_SOURCE_KEY_MD5    = "copy-source-server-side-encryption-customer-key-MD5"
   101  
   102  	HEADER_SSEKMS_KEY_AMZ = "x-amz-server-side-encryption-aws-kms-key-id"
   103  
   104  	HEADER_SSEKMS_KEY_OBS = "x-obs-server-side-encryption-kms-key-id"
   105  
   106  	HEADER_SUCCESS_ACTION_REDIRECT = "success_action_redirect"
   107  
   108  	headerFSFileInterface = "fs-file-interface"
   109  
   110  	HEADER_DATE_CAMEL                          = "Date"
   111  	HEADER_HOST_CAMEL                          = "Host"
   112  	HEADER_HOST                                = "host"
   113  	HEADER_AUTH_CAMEL                          = "Authorization"
   114  	HEADER_MD5_CAMEL                           = "Content-MD5"
   115  	HEADER_LOCATION_CAMEL                      = "Location"
   116  	HEADER_CONTENT_LENGTH_CAMEL                = "Content-Length"
   117  	HEADER_CONTENT_TYPE_CAML                   = "Content-Type"
   118  	HEADER_USER_AGENT_CAMEL                    = "User-Agent"
   119  	HEADER_ORIGIN_CAMEL                        = "Origin"
   120  	HEADER_ACCESS_CONTROL_REQUEST_HEADER_CAMEL = "Access-Control-Request-Headers"
   121  	HEADER_CACHE_CONTROL_CAMEL                 = "Cache-Control"
   122  	HEADER_CONTENT_DISPOSITION_CAMEL           = "Content-Disposition"
   123  	HEADER_CONTENT_ENCODING_CAMEL              = "Content-Encoding"
   124  	HEADER_CONTENT_LANGUAGE_CAMEL              = "Content-Language"
   125  	HEADER_EXPIRES_CAMEL                       = "Expires"
   126  
   127  	PARAM_VERSION_ID                   = "versionId"
   128  	PARAM_RESPONSE_CONTENT_TYPE        = "response-content-type"
   129  	PARAM_RESPONSE_CONTENT_LANGUAGE    = "response-content-language"
   130  	PARAM_RESPONSE_EXPIRES             = "response-expires"
   131  	PARAM_RESPONSE_CACHE_CONTROL       = "response-cache-control"
   132  	PARAM_RESPONSE_CONTENT_DISPOSITION = "response-content-disposition"
   133  	PARAM_RESPONSE_CONTENT_ENCODING    = "response-content-encoding"
   134  	PARAM_IMAGE_PROCESS                = "x-image-process"
   135  
   136  	PARAM_ALGORITHM_AMZ_CAMEL     = "X-Amz-Algorithm"
   137  	PARAM_CREDENTIAL_AMZ_CAMEL    = "X-Amz-Credential"
   138  	PARAM_DATE_AMZ_CAMEL          = "X-Amz-Date"
   139  	PARAM_DATE_OBS_CAMEL          = "X-Obs-Date"
   140  	PARAM_EXPIRES_AMZ_CAMEL       = "X-Amz-Expires"
   141  	PARAM_SIGNEDHEADERS_AMZ_CAMEL = "X-Amz-SignedHeaders"
   142  	PARAM_SIGNATURE_AMZ_CAMEL     = "X-Amz-Signature"
   143  
   144  	DEFAULT_SIGNATURE            = SignatureV2
   145  	DEFAULT_REGION               = "region"
   146  	DEFAULT_CONNECT_TIMEOUT      = 60
   147  	DEFAULT_SOCKET_TIMEOUT       = 60
   148  	DEFAULT_HEADER_TIMEOUT       = 60
   149  	DEFAULT_IDLE_CONN_TIMEOUT    = 30
   150  	DEFAULT_MAX_RETRY_COUNT      = 3
   151  	DEFAULT_MAX_REDIRECT_COUNT   = 3
   152  	DEFAULT_MAX_CONN_PER_HOST    = 1000
   153  	EMPTY_CONTENT_SHA256         = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
   154  	UNSIGNED_PAYLOAD             = "UNSIGNED-PAYLOAD"
   155  	LONG_DATE_FORMAT             = "20060102T150405Z"
   156  	SHORT_DATE_FORMAT            = "20060102"
   157  	ISO8601_DATE_FORMAT          = "2006-01-02T15:04:05Z"
   158  	ISO8601_MIDNIGHT_DATE_FORMAT = "2006-01-02T00:00:00Z"
   159  	RFC1123_FORMAT               = "Mon, 02 Jan 2006 15:04:05 GMT"
   160  
   161  	V4_SERVICE_NAME   = "s3"
   162  	V4_SERVICE_SUFFIX = "aws4_request"
   163  
   164  	V2_HASH_PREFIX  = "AWS"
   165  	OBS_HASH_PREFIX = "OBS"
   166  
   167  	V4_HASH_PREFIX = "AWS4-HMAC-SHA256"
   168  	V4_HASH_PRE    = "AWS4"
   169  
   170  	DEFAULT_SSE_KMS_ENCRYPTION     = "aws:kms"
   171  	DEFAULT_SSE_KMS_ENCRYPTION_OBS = "kms"
   172  
   173  	DEFAULT_SSE_C_ENCRYPTION = "AES256"
   174  
   175  	HTTP_GET     = "GET"
   176  	HTTP_POST    = "POST"
   177  	HTTP_PUT     = "PUT"
   178  	HTTP_DELETE  = "DELETE"
   179  	HTTP_HEAD    = "HEAD"
   180  	HTTP_OPTIONS = "OPTIONS"
   181  
   182  	REQUEST_PAYER = "request-payer"
   183  	MULTI_AZ      = "3az"
   184  
   185  	MAX_PART_SIZE     = 5 * 1024 * 1024 * 1024
   186  	MIN_PART_SIZE     = 100 * 1024
   187  	DEFAULT_PART_SIZE = 9 * 1024 * 1024
   188  	MAX_PART_NUM      = 10000
   189  )
   190  
   191  // SignatureType defines type of signature
   192  type SignatureType string
   193  
   194  const (
   195  	// SignatureV2 signature type v2
   196  	SignatureV2 SignatureType = "v2"
   197  	// SignatureV4 signature type v4
   198  	SignatureV4 SignatureType = "v4"
   199  	// SignatureObs signature type OBS
   200  	SignatureObs SignatureType = "OBS"
   201  )
   202  
   203  var (
   204  	interestedHeaders = []string{"content-md5", "content-type", "date"}
   205  
   206  	allowedRequestHTTPHeaderMetadataNames = map[string]bool{
   207  		"content-type":                   true,
   208  		"content-md5":                    true,
   209  		"content-length":                 true,
   210  		"content-language":               true,
   211  		"expires":                        true,
   212  		"origin":                         true,
   213  		"cache-control":                  true,
   214  		"content-disposition":            true,
   215  		"content-encoding":               true,
   216  		"access-control-request-method":  true,
   217  		"access-control-request-headers": true,
   218  		"x-default-storage-class":        true,
   219  		"location":                       true,
   220  		"date":                           true,
   221  		"etag":                           true,
   222  		"range":                          true,
   223  		"host":                           true,
   224  		"if-modified-since":              true,
   225  		"if-unmodified-since":            true,
   226  		"if-match":                       true,
   227  		"if-none-match":                  true,
   228  		"last-modified":                  true,
   229  		"content-range":                  true,
   230  	}
   231  
   232  	allowedResourceParameterNames = map[string]bool{
   233  		"acl":                          true,
   234  		"backtosource":                 true,
   235  		"metadata":                     true,
   236  		"policy":                       true,
   237  		"torrent":                      true,
   238  		"logging":                      true,
   239  		"location":                     true,
   240  		"storageinfo":                  true,
   241  		"quota":                        true,
   242  		"storageclass":                 true,
   243  		"storagepolicy":                true,
   244  		"requestpayment":               true,
   245  		"versions":                     true,
   246  		"versioning":                   true,
   247  		"versionid":                    true,
   248  		"uploads":                      true,
   249  		"uploadid":                     true,
   250  		"partnumber":                   true,
   251  		"website":                      true,
   252  		"notification":                 true,
   253  		"lifecycle":                    true,
   254  		"deletebucket":                 true,
   255  		"delete":                       true,
   256  		"cors":                         true,
   257  		"restore":                      true,
   258  		"encryption":                   true,
   259  		"tagging":                      true,
   260  		"append":                       true,
   261  		"position":                     true,
   262  		"replication":                  true,
   263  		"response-content-type":        true,
   264  		"response-content-language":    true,
   265  		"response-expires":             true,
   266  		"response-cache-control":       true,
   267  		"response-content-disposition": true,
   268  		"response-content-encoding":    true,
   269  		"x-image-process":              true,
   270  		"x-oss-process":                true,
   271  		"x-image-save-bucket":          true,
   272  		"x-image-save-object":          true,
   273  		"ignore-sign-in-query":         true,
   274  	}
   275  
   276  	mimeTypes = map[string]string{
   277  		"001":     "application/x-001",
   278  		"301":     "application/x-301",
   279  		"323":     "text/h323",
   280  		"7z":      "application/x-7z-compressed",
   281  		"906":     "application/x-906",
   282  		"907":     "drawing/907",
   283  		"IVF":     "video/x-ivf",
   284  		"a11":     "application/x-a11",
   285  		"aac":     "audio/x-aac",
   286  		"acp":     "audio/x-mei-aac",
   287  		"ai":      "application/postscript",
   288  		"aif":     "audio/aiff",
   289  		"aifc":    "audio/aiff",
   290  		"aiff":    "audio/aiff",
   291  		"anv":     "application/x-anv",
   292  		"apk":     "application/vnd.android.package-archive",
   293  		"asa":     "text/asa",
   294  		"asf":     "video/x-ms-asf",
   295  		"asp":     "text/asp",
   296  		"asx":     "video/x-ms-asf",
   297  		"atom":    "application/atom+xml",
   298  		"au":      "audio/basic",
   299  		"avi":     "video/avi",
   300  		"awf":     "application/vnd.adobe.workflow",
   301  		"biz":     "text/xml",
   302  		"bmp":     "application/x-bmp",
   303  		"bot":     "application/x-bot",
   304  		"bz2":     "application/x-bzip2",
   305  		"c4t":     "application/x-c4t",
   306  		"c90":     "application/x-c90",
   307  		"cal":     "application/x-cals",
   308  		"cat":     "application/vnd.ms-pki.seccat",
   309  		"cdf":     "application/x-netcdf",
   310  		"cdr":     "application/x-cdr",
   311  		"cel":     "application/x-cel",
   312  		"cer":     "application/x-x509-ca-cert",
   313  		"cg4":     "application/x-g4",
   314  		"cgm":     "application/x-cgm",
   315  		"cit":     "application/x-cit",
   316  		"class":   "java/*",
   317  		"cml":     "text/xml",
   318  		"cmp":     "application/x-cmp",
   319  		"cmx":     "application/x-cmx",
   320  		"cot":     "application/x-cot",
   321  		"crl":     "application/pkix-crl",
   322  		"crt":     "application/x-x509-ca-cert",
   323  		"csi":     "application/x-csi",
   324  		"css":     "text/css",
   325  		"csv":     "text/csv",
   326  		"cu":      "application/cu-seeme",
   327  		"cut":     "application/x-cut",
   328  		"dbf":     "application/x-dbf",
   329  		"dbm":     "application/x-dbm",
   330  		"dbx":     "application/x-dbx",
   331  		"dcd":     "text/xml",
   332  		"dcx":     "application/x-dcx",
   333  		"deb":     "application/x-debian-package",
   334  		"der":     "application/x-x509-ca-cert",
   335  		"dgn":     "application/x-dgn",
   336  		"dib":     "application/x-dib",
   337  		"dll":     "application/x-msdownload",
   338  		"doc":     "application/msword",
   339  		"docx":    "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
   340  		"dot":     "application/msword",
   341  		"drw":     "application/x-drw",
   342  		"dtd":     "text/xml",
   343  		"dvi":     "application/x-dvi",
   344  		"dwf":     "application/x-dwf",
   345  		"dwg":     "application/x-dwg",
   346  		"dxb":     "application/x-dxb",
   347  		"dxf":     "application/x-dxf",
   348  		"edn":     "application/vnd.adobe.edn",
   349  		"emf":     "application/x-emf",
   350  		"eml":     "message/rfc822",
   351  		"ent":     "text/xml",
   352  		"eot":     "application/vnd.ms-fontobject",
   353  		"epi":     "application/x-epi",
   354  		"eps":     "application/postscript",
   355  		"epub":    "application/epub+zip",
   356  		"etd":     "application/x-ebx",
   357  		"etx":     "text/x-setext",
   358  		"exe":     "application/x-msdownload",
   359  		"fax":     "image/fax",
   360  		"fdf":     "application/vnd.fdf",
   361  		"fif":     "application/fractals",
   362  		"flac":    "audio/flac",
   363  		"flv":     "video/x-flv",
   364  		"fo":      "text/xml",
   365  		"frm":     "application/x-frm",
   366  		"g4":      "application/x-g4",
   367  		"gbr":     "application/x-gbr",
   368  		"gif":     "image/gif",
   369  		"gl2":     "application/x-gl2",
   370  		"gp4":     "application/x-gp4",
   371  		"gz":      "application/gzip",
   372  		"hgl":     "application/x-hgl",
   373  		"hmr":     "application/x-hmr",
   374  		"hpg":     "application/x-hpgl",
   375  		"hpl":     "application/x-hpl",
   376  		"hqx":     "application/mac-binhex40",
   377  		"hrf":     "application/x-hrf",
   378  		"hta":     "application/hta",
   379  		"htc":     "text/x-component",
   380  		"htm":     "text/html",
   381  		"html":    "text/html",
   382  		"htt":     "text/webviewhtml",
   383  		"htx":     "text/html",
   384  		"icb":     "application/x-icb",
   385  		"ico":     "application/x-ico",
   386  		"ics":     "text/calendar",
   387  		"iff":     "application/x-iff",
   388  		"ig4":     "application/x-g4",
   389  		"igs":     "application/x-igs",
   390  		"iii":     "application/x-iphone",
   391  		"img":     "application/x-img",
   392  		"ini":     "text/plain",
   393  		"ins":     "application/x-internet-signup",
   394  		"ipa":     "application/vnd.iphone",
   395  		"iso":     "application/x-iso9660-image",
   396  		"isp":     "application/x-internet-signup",
   397  		"jar":     "application/java-archive",
   398  		"java":    "java/*",
   399  		"jfif":    "image/jpeg",
   400  		"jpe":     "image/jpeg",
   401  		"jpeg":    "image/jpeg",
   402  		"jpg":     "image/jpeg",
   403  		"js":      "application/x-javascript",
   404  		"json":    "application/json",
   405  		"jsp":     "text/html",
   406  		"la1":     "audio/x-liquid-file",
   407  		"lar":     "application/x-laplayer-reg",
   408  		"latex":   "application/x-latex",
   409  		"lavs":    "audio/x-liquid-secure",
   410  		"lbm":     "application/x-lbm",
   411  		"lmsff":   "audio/x-la-lms",
   412  		"log":     "text/plain",
   413  		"ls":      "application/x-javascript",
   414  		"ltr":     "application/x-ltr",
   415  		"m1v":     "video/x-mpeg",
   416  		"m2v":     "video/x-mpeg",
   417  		"m3u":     "audio/mpegurl",
   418  		"m4a":     "audio/mp4",
   419  		"m4e":     "video/mpeg4",
   420  		"m4v":     "video/mp4",
   421  		"mac":     "application/x-mac",
   422  		"man":     "application/x-troff-man",
   423  		"math":    "text/xml",
   424  		"mdb":     "application/msaccess",
   425  		"mfp":     "application/x-shockwave-flash",
   426  		"mht":     "message/rfc822",
   427  		"mhtml":   "message/rfc822",
   428  		"mi":      "application/x-mi",
   429  		"mid":     "audio/mid",
   430  		"midi":    "audio/mid",
   431  		"mil":     "application/x-mil",
   432  		"mml":     "text/xml",
   433  		"mnd":     "audio/x-musicnet-download",
   434  		"mns":     "audio/x-musicnet-stream",
   435  		"mocha":   "application/x-javascript",
   436  		"mov":     "video/quicktime",
   437  		"movie":   "video/x-sgi-movie",
   438  		"mp1":     "audio/mp1",
   439  		"mp2":     "audio/mp2",
   440  		"mp2v":    "video/mpeg",
   441  		"mp3":     "audio/mp3",
   442  		"mp4":     "video/mp4",
   443  		"mp4a":    "audio/mp4",
   444  		"mp4v":    "video/mp4",
   445  		"mpa":     "video/x-mpg",
   446  		"mpd":     "application/vnd.ms-project",
   447  		"mpe":     "video/mpeg",
   448  		"mpeg":    "video/mpeg",
   449  		"mpg":     "video/mpeg",
   450  		"mpg4":    "video/mp4",
   451  		"mpga":    "audio/rn-mpeg",
   452  		"mpp":     "application/vnd.ms-project",
   453  		"mps":     "video/x-mpeg",
   454  		"mpt":     "application/vnd.ms-project",
   455  		"mpv":     "video/mpg",
   456  		"mpv2":    "video/mpeg",
   457  		"mpw":     "application/vnd.ms-project",
   458  		"mpx":     "application/vnd.ms-project",
   459  		"mtx":     "text/xml",
   460  		"mxp":     "application/x-mmxp",
   461  		"net":     "image/pnetvue",
   462  		"nrf":     "application/x-nrf",
   463  		"nws":     "message/rfc822",
   464  		"odc":     "text/x-ms-odc",
   465  		"oga":     "audio/ogg",
   466  		"ogg":     "audio/ogg",
   467  		"ogv":     "video/ogg",
   468  		"ogx":     "application/ogg",
   469  		"out":     "application/x-out",
   470  		"p10":     "application/pkcs10",
   471  		"p12":     "application/x-pkcs12",
   472  		"p7b":     "application/x-pkcs7-certificates",
   473  		"p7c":     "application/pkcs7-mime",
   474  		"p7m":     "application/pkcs7-mime",
   475  		"p7r":     "application/x-pkcs7-certreqresp",
   476  		"p7s":     "application/pkcs7-signature",
   477  		"pbm":     "image/x-portable-bitmap",
   478  		"pc5":     "application/x-pc5",
   479  		"pci":     "application/x-pci",
   480  		"pcl":     "application/x-pcl",
   481  		"pcx":     "application/x-pcx",
   482  		"pdf":     "application/pdf",
   483  		"pdx":     "application/vnd.adobe.pdx",
   484  		"pfx":     "application/x-pkcs12",
   485  		"pgl":     "application/x-pgl",
   486  		"pgm":     "image/x-portable-graymap",
   487  		"pic":     "application/x-pic",
   488  		"pko":     "application/vnd.ms-pki.pko",
   489  		"pl":      "application/x-perl",
   490  		"plg":     "text/html",
   491  		"pls":     "audio/scpls",
   492  		"plt":     "application/x-plt",
   493  		"png":     "image/png",
   494  		"pnm":     "image/x-portable-anymap",
   495  		"pot":     "application/vnd.ms-powerpoint",
   496  		"ppa":     "application/vnd.ms-powerpoint",
   497  		"ppm":     "application/x-ppm",
   498  		"pps":     "application/vnd.ms-powerpoint",
   499  		"ppt":     "application/vnd.ms-powerpoint",
   500  		"pptx":    "application/vnd.openxmlformats-officedocument.presentationml.presentation",
   501  		"pr":      "application/x-pr",
   502  		"prf":     "application/pics-rules",
   503  		"prn":     "application/x-prn",
   504  		"prt":     "application/x-prt",
   505  		"ps":      "application/postscript",
   506  		"ptn":     "application/x-ptn",
   507  		"pwz":     "application/vnd.ms-powerpoint",
   508  		"qt":      "video/quicktime",
   509  		"r3t":     "text/vnd.rn-realtext3d",
   510  		"ra":      "audio/vnd.rn-realaudio",
   511  		"ram":     "audio/x-pn-realaudio",
   512  		"rar":     "application/x-rar-compressed",
   513  		"ras":     "application/x-ras",
   514  		"rat":     "application/rat-file",
   515  		"rdf":     "text/xml",
   516  		"rec":     "application/vnd.rn-recording",
   517  		"red":     "application/x-red",
   518  		"rgb":     "application/x-rgb",
   519  		"rjs":     "application/vnd.rn-realsystem-rjs",
   520  		"rjt":     "application/vnd.rn-realsystem-rjt",
   521  		"rlc":     "application/x-rlc",
   522  		"rle":     "application/x-rle",
   523  		"rm":      "application/vnd.rn-realmedia",
   524  		"rmf":     "application/vnd.adobe.rmf",
   525  		"rmi":     "audio/mid",
   526  		"rmj":     "application/vnd.rn-realsystem-rmj",
   527  		"rmm":     "audio/x-pn-realaudio",
   528  		"rmp":     "application/vnd.rn-rn_music_package",
   529  		"rms":     "application/vnd.rn-realmedia-secure",
   530  		"rmvb":    "application/vnd.rn-realmedia-vbr",
   531  		"rmx":     "application/vnd.rn-realsystem-rmx",
   532  		"rnx":     "application/vnd.rn-realplayer",
   533  		"rp":      "image/vnd.rn-realpix",
   534  		"rpm":     "audio/x-pn-realaudio-plugin",
   535  		"rsml":    "application/vnd.rn-rsml",
   536  		"rss":     "application/rss+xml",
   537  		"rt":      "text/vnd.rn-realtext",
   538  		"rtf":     "application/x-rtf",
   539  		"rv":      "video/vnd.rn-realvideo",
   540  		"sam":     "application/x-sam",
   541  		"sat":     "application/x-sat",
   542  		"sdp":     "application/sdp",
   543  		"sdw":     "application/x-sdw",
   544  		"sgm":     "text/sgml",
   545  		"sgml":    "text/sgml",
   546  		"sis":     "application/vnd.symbian.install",
   547  		"sisx":    "application/vnd.symbian.install",
   548  		"sit":     "application/x-stuffit",
   549  		"slb":     "application/x-slb",
   550  		"sld":     "application/x-sld",
   551  		"slk":     "drawing/x-slk",
   552  		"smi":     "application/smil",
   553  		"smil":    "application/smil",
   554  		"smk":     "application/x-smk",
   555  		"snd":     "audio/basic",
   556  		"sol":     "text/plain",
   557  		"sor":     "text/plain",
   558  		"spc":     "application/x-pkcs7-certificates",
   559  		"spl":     "application/futuresplash",
   560  		"spp":     "text/xml",
   561  		"ssm":     "application/streamingmedia",
   562  		"sst":     "application/vnd.ms-pki.certstore",
   563  		"stl":     "application/vnd.ms-pki.stl",
   564  		"stm":     "text/html",
   565  		"sty":     "application/x-sty",
   566  		"svg":     "image/svg+xml",
   567  		"swf":     "application/x-shockwave-flash",
   568  		"tar":     "application/x-tar",
   569  		"tdf":     "application/x-tdf",
   570  		"tg4":     "application/x-tg4",
   571  		"tga":     "application/x-tga",
   572  		"tif":     "image/tiff",
   573  		"tiff":    "image/tiff",
   574  		"tld":     "text/xml",
   575  		"top":     "drawing/x-top",
   576  		"torrent": "application/x-bittorrent",
   577  		"tsd":     "text/xml",
   578  		"ttf":     "application/x-font-ttf",
   579  		"txt":     "text/plain",
   580  		"uin":     "application/x-icq",
   581  		"uls":     "text/iuls",
   582  		"vcf":     "text/x-vcard",
   583  		"vda":     "application/x-vda",
   584  		"vdx":     "application/vnd.visio",
   585  		"vml":     "text/xml",
   586  		"vpg":     "application/x-vpeg005",
   587  		"vsd":     "application/vnd.visio",
   588  		"vss":     "application/vnd.visio",
   589  		"vst":     "application/x-vst",
   590  		"vsw":     "application/vnd.visio",
   591  		"vsx":     "application/vnd.visio",
   592  		"vtx":     "application/vnd.visio",
   593  		"vxml":    "text/xml",
   594  		"wav":     "audio/wav",
   595  		"wax":     "audio/x-ms-wax",
   596  		"wb1":     "application/x-wb1",
   597  		"wb2":     "application/x-wb2",
   598  		"wb3":     "application/x-wb3",
   599  		"wbmp":    "image/vnd.wap.wbmp",
   600  		"webm":    "video/webm",
   601  		"wiz":     "application/msword",
   602  		"wk3":     "application/x-wk3",
   603  		"wk4":     "application/x-wk4",
   604  		"wkq":     "application/x-wkq",
   605  		"wks":     "application/x-wks",
   606  		"wm":      "video/x-ms-wm",
   607  		"wma":     "audio/x-ms-wma",
   608  		"wmd":     "application/x-ms-wmd",
   609  		"wmf":     "application/x-wmf",
   610  		"wml":     "text/vnd.wap.wml",
   611  		"wmv":     "video/x-ms-wmv",
   612  		"wmx":     "video/x-ms-wmx",
   613  		"wmz":     "application/x-ms-wmz",
   614  		"woff":    "application/x-font-woff",
   615  		"wp6":     "application/x-wp6",
   616  		"wpd":     "application/x-wpd",
   617  		"wpg":     "application/x-wpg",
   618  		"wpl":     "application/vnd.ms-wpl",
   619  		"wq1":     "application/x-wq1",
   620  		"wr1":     "application/x-wr1",
   621  		"wri":     "application/x-wri",
   622  		"wrk":     "application/x-wrk",
   623  		"ws":      "application/x-ws",
   624  		"ws2":     "application/x-ws",
   625  		"wsc":     "text/scriptlet",
   626  		"wsdl":    "text/xml",
   627  		"wvx":     "video/x-ms-wvx",
   628  		"x_b":     "application/x-x_b",
   629  		"x_t":     "application/x-x_t",
   630  		"xap":     "application/x-silverlight-app",
   631  		"xbm":     "image/x-xbitmap",
   632  		"xdp":     "application/vnd.adobe.xdp",
   633  		"xdr":     "text/xml",
   634  		"xfd":     "application/vnd.adobe.xfd",
   635  		"xfdf":    "application/vnd.adobe.xfdf",
   636  		"xhtml":   "text/html",
   637  		"xls":     "application/vnd.ms-excel",
   638  		"xlsx":    "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
   639  		"xlw":     "application/x-xlw",
   640  		"xml":     "text/xml",
   641  		"xpl":     "audio/scpls",
   642  		"xpm":     "image/x-xpixmap",
   643  		"xq":      "text/xml",
   644  		"xql":     "text/xml",
   645  		"xquery":  "text/xml",
   646  		"xsd":     "text/xml",
   647  		"xsl":     "text/xml",
   648  		"xslt":    "text/xml",
   649  		"xwd":     "application/x-xwd",
   650  		"yaml":    "text/yaml",
   651  		"yml":     "text/yaml",
   652  		"zip":     "application/zip",
   653  	}
   654  )
   655  
   656  // HttpMethodType defines http method type
   657  type HttpMethodType string
   658  
   659  const (
   660  	HttpMethodGet     HttpMethodType = HTTP_GET
   661  	HttpMethodPut     HttpMethodType = HTTP_PUT
   662  	HttpMethodPost    HttpMethodType = HTTP_POST
   663  	HttpMethodDelete  HttpMethodType = HTTP_DELETE
   664  	HttpMethodHead    HttpMethodType = HTTP_HEAD
   665  	HttpMethodOptions HttpMethodType = HTTP_OPTIONS
   666  )
   667  
   668  // SubResourceType defines the subResource value
   669  type SubResourceType string
   670  
   671  const (
   672  	// SubResourceStoragePolicy subResource value: storagePolicy
   673  	SubResourceStoragePolicy SubResourceType = "storagePolicy"
   674  
   675  	// SubResourceStorageClass subResource value: storageClass
   676  	SubResourceStorageClass SubResourceType = "storageClass"
   677  
   678  	// SubResourceQuota subResource value: quota
   679  	SubResourceQuota SubResourceType = "quota"
   680  
   681  	// SubResourceStorageInfo subResource value: storageinfo
   682  	SubResourceStorageInfo SubResourceType = "storageinfo"
   683  
   684  	// SubResourceLocation subResource value: location
   685  	SubResourceLocation SubResourceType = "location"
   686  
   687  	// SubResourceAcl subResource value: acl
   688  	SubResourceAcl SubResourceType = "acl"
   689  
   690  	// SubResourcePolicy subResource value: policy
   691  	SubResourcePolicy SubResourceType = "policy"
   692  
   693  	// SubResourceCors subResource value: cors
   694  	SubResourceCors SubResourceType = "cors"
   695  
   696  	// SubResourceVersioning subResource value: versioning
   697  	SubResourceVersioning SubResourceType = "versioning"
   698  
   699  	// SubResourceWebsite subResource value: website
   700  	SubResourceWebsite SubResourceType = "website"
   701  
   702  	// SubResourceLogging subResource value: logging
   703  	SubResourceLogging SubResourceType = "logging"
   704  
   705  	// SubResourceLifecycle subResource value: lifecycle
   706  	SubResourceLifecycle SubResourceType = "lifecycle"
   707  
   708  	// SubResourceNotification subResource value: notification
   709  	SubResourceNotification SubResourceType = "notification"
   710  
   711  	// SubResourceEncryption subResource value: encryption
   712  	SubResourceEncryption SubResourceType = "encryption"
   713  
   714  	// SubResourceTagging subResource value: tagging
   715  	SubResourceTagging SubResourceType = "tagging"
   716  
   717  	// SubResourceDelete subResource value: delete
   718  	SubResourceDelete SubResourceType = "delete"
   719  
   720  	// SubResourceVersions subResource value: versions
   721  	SubResourceVersions SubResourceType = "versions"
   722  
   723  	// SubResourceUploads subResource value: uploads
   724  	SubResourceUploads SubResourceType = "uploads"
   725  
   726  	// SubResourceRestore subResource value: restore
   727  	SubResourceRestore SubResourceType = "restore"
   728  
   729  	// SubResourceMetadata subResource value: metadata
   730  	SubResourceMetadata SubResourceType = "metadata"
   731  
   732  	// SubResourceRequestPayment subResource value: requestPayment
   733  	SubResourceRequestPayment SubResourceType = "requestPayment"
   734  )
   735  
   736  // objectKeyType defines the objectKey value
   737  type objectKeyType string
   738  
   739  const (
   740  	// objectKeyExtensionPolicy objectKey value: v1/extension_policy
   741  	objectKeyExtensionPolicy objectKeyType = "v1/extension_policy"
   742  
   743  	// objectKeyAsyncFetchJob objectKey value: v1/async-fetch/jobs
   744  	objectKeyAsyncFetchJob objectKeyType = "v1/async-fetch/jobs"
   745  )
   746  
   747  // AclType defines bucket/object acl type
   748  type AclType string
   749  
   750  const (
   751  	AclPrivate                 AclType = "private"
   752  	AclPublicRead              AclType = "public-read"
   753  	AclPublicReadWrite         AclType = "public-read-write"
   754  	AclAuthenticatedRead       AclType = "authenticated-read"
   755  	AclBucketOwnerRead         AclType = "bucket-owner-read"
   756  	AclBucketOwnerFullControl  AclType = "bucket-owner-full-control"
   757  	AclLogDeliveryWrite        AclType = "log-delivery-write"
   758  	AclPublicReadDelivery      AclType = "public-read-delivered"
   759  	AclPublicReadWriteDelivery AclType = "public-read-write-delivered"
   760  )
   761  
   762  // StorageClassType defines bucket storage class
   763  type StorageClassType string
   764  
   765  const (
   766  	//StorageClassStandard storage class: STANDARD
   767  	StorageClassStandard StorageClassType = "STANDARD"
   768  
   769  	//StorageClassWarm storage class: WARM
   770  	StorageClassWarm StorageClassType = "WARM"
   771  
   772  	//StorageClassCold storage class: COLD
   773  	StorageClassCold StorageClassType = "COLD"
   774  
   775  	storageClassStandardIA StorageClassType = "STANDARD_IA"
   776  	storageClassGlacier    StorageClassType = "GLACIER"
   777  )
   778  
   779  // PermissionType defines permission type
   780  type PermissionType string
   781  
   782  const (
   783  	// PermissionRead permission type: READ
   784  	PermissionRead PermissionType = "READ"
   785  
   786  	// PermissionWrite permission type: WRITE
   787  	PermissionWrite PermissionType = "WRITE"
   788  
   789  	// PermissionReadAcp permission type: READ_ACP
   790  	PermissionReadAcp PermissionType = "READ_ACP"
   791  
   792  	// PermissionWriteAcp permission type: WRITE_ACP
   793  	PermissionWriteAcp PermissionType = "WRITE_ACP"
   794  
   795  	// PermissionFullControl permission type: FULL_CONTROL
   796  	PermissionFullControl PermissionType = "FULL_CONTROL"
   797  )
   798  
   799  // GranteeType defines grantee type
   800  type GranteeType string
   801  
   802  const (
   803  	// GranteeGroup grantee type: Group
   804  	GranteeGroup GranteeType = "Group"
   805  
   806  	// GranteeUser grantee type: CanonicalUser
   807  	GranteeUser GranteeType = "CanonicalUser"
   808  )
   809  
   810  // GroupUriType defines grantee uri type
   811  type GroupUriType string
   812  
   813  const (
   814  	// GroupAllUsers grantee uri type: AllUsers
   815  	GroupAllUsers GroupUriType = "AllUsers"
   816  
   817  	// GroupAuthenticatedUsers grantee uri type: AuthenticatedUsers
   818  	GroupAuthenticatedUsers GroupUriType = "AuthenticatedUsers"
   819  
   820  	// GroupLogDelivery grantee uri type: LogDelivery
   821  	GroupLogDelivery GroupUriType = "LogDelivery"
   822  )
   823  
   824  // VersioningStatusType defines bucket version status
   825  type VersioningStatusType string
   826  
   827  const (
   828  	// VersioningStatusEnabled version status: Enabled
   829  	VersioningStatusEnabled VersioningStatusType = "Enabled"
   830  
   831  	// VersioningStatusSuspended version status: Suspended
   832  	VersioningStatusSuspended VersioningStatusType = "Suspended"
   833  )
   834  
   835  // ProtocolType defines protocol type
   836  type ProtocolType string
   837  
   838  const (
   839  	// ProtocolHttp prorocol type: http
   840  	ProtocolHttp ProtocolType = "http"
   841  
   842  	// ProtocolHttps prorocol type: https
   843  	ProtocolHttps ProtocolType = "https"
   844  )
   845  
   846  // RuleStatusType defines lifeCycle rule status
   847  type RuleStatusType string
   848  
   849  const (
   850  	// RuleStatusEnabled rule status: Enabled
   851  	RuleStatusEnabled RuleStatusType = "Enabled"
   852  
   853  	// RuleStatusDisabled rule status: Disabled
   854  	RuleStatusDisabled RuleStatusType = "Disabled"
   855  )
   856  
   857  // RestoreTierType defines restore options
   858  type RestoreTierType string
   859  
   860  const (
   861  	// RestoreTierExpedited restore options: Expedited
   862  	RestoreTierExpedited RestoreTierType = "Expedited"
   863  
   864  	// RestoreTierStandard restore options: Standard
   865  	RestoreTierStandard RestoreTierType = "Standard"
   866  
   867  	// RestoreTierBulk restore options: Bulk
   868  	RestoreTierBulk RestoreTierType = "Bulk"
   869  )
   870  
   871  // MetadataDirectiveType defines metadata operation indicator
   872  type MetadataDirectiveType string
   873  
   874  const (
   875  	// CopyMetadata metadata operation: COPY
   876  	CopyMetadata MetadataDirectiveType = "COPY"
   877  
   878  	// ReplaceNew metadata operation: REPLACE_NEW
   879  	ReplaceNew MetadataDirectiveType = "REPLACE_NEW"
   880  
   881  	// ReplaceMetadata metadata operation: REPLACE
   882  	ReplaceMetadata MetadataDirectiveType = "REPLACE"
   883  )
   884  
   885  // EventType defines bucket notification type of events
   886  type EventType string
   887  
   888  const (
   889  	// ObjectCreatedAll type of events: ObjectCreated:*
   890  	ObjectCreatedAll EventType = "ObjectCreated:*"
   891  
   892  	// ObjectCreatedPut type of events: ObjectCreated:Put
   893  	ObjectCreatedPut EventType = "ObjectCreated:Put"
   894  
   895  	// ObjectCreatedPost type of events: ObjectCreated:Post
   896  	ObjectCreatedPost EventType = "ObjectCreated:Post"
   897  
   898  	// ObjectCreatedCopy type of events: ObjectCreated:Copy
   899  	ObjectCreatedCopy EventType = "ObjectCreated:Copy"
   900  
   901  	// ObjectCreatedCompleteMultipartUpload type of events: ObjectCreated:CompleteMultipartUpload
   902  	ObjectCreatedCompleteMultipartUpload EventType = "ObjectCreated:CompleteMultipartUpload"
   903  
   904  	// ObjectRemovedAll type of events: ObjectRemoved:*
   905  	ObjectRemovedAll EventType = "ObjectRemoved:*"
   906  
   907  	// ObjectRemovedDelete type of events: ObjectRemoved:Delete
   908  	ObjectRemovedDelete EventType = "ObjectRemoved:Delete"
   909  
   910  	// ObjectRemovedDeleteMarkerCreated type of events: ObjectRemoved:DeleteMarkerCreated
   911  	ObjectRemovedDeleteMarkerCreated EventType = "ObjectRemoved:DeleteMarkerCreated"
   912  )
   913  
   914  // PayerType defines type of payer
   915  type PayerType string
   916  
   917  const (
   918  	// BucketOwnerPayer type of payer: BucketOwner
   919  	BucketOwnerPayer PayerType = "BucketOwner"
   920  
   921  	// RequesterPayer type of payer: Requester
   922  	RequesterPayer PayerType = "Requester"
   923  
   924  	// Requester header for requester-Pays
   925  	Requester PayerType = "requester"
   926  )
   927  
   928  // FetchPolicyStatusType defines type of fetch policy status
   929  type FetchPolicyStatusType string
   930  
   931  const (
   932  	// FetchStatusOpen type of status: open
   933  	FetchStatusOpen FetchPolicyStatusType = "open"
   934  
   935  	// FetchStatusClosed type of status: closed
   936  	FetchStatusClosed FetchPolicyStatusType = "closed"
   937  )
   938  
   939  // AvailableZoneType defines type of az redundancy
   940  type AvailableZoneType string
   941  
   942  const (
   943  	AvailableZoneMultiAz AvailableZoneType = "3az"
   944  )
   945  
   946  // FSStatusType defines type of file system status
   947  type FSStatusType string
   948  
   949  const (
   950  	FSStatusEnabled  FSStatusType = "Enabled"
   951  	FSStatusDisabled FSStatusType = "Disabled"
   952  )