Contains the Concourse pipeline definition for building a line-server container
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

804 lines
65 KiB

  1. package main
  2. import (
  3. "math/rand"
  4. "time"
  5. )
  6. // from http://stackoverflow.com/a/31832326
  7. var src = rand.NewSource(time.Now().UnixNano())
  8. var mimeToExtension = map[string]string{
  9. "application/andrew-inset": "ez",
  10. "application/applixware": "aw",
  11. "application/atom+xml": "atom",
  12. "application/atomcat+xml": "atomcat",
  13. "application/atomsvc+xml": "atomsvc",
  14. "application/ccxml+xml": "ccxml",
  15. "application/cdmi-capability": "cdmia",
  16. "application/cdmi-container": "cdmic",
  17. "application/cdmi-domain": "cdmid",
  18. "application/cdmi-object": "cdmio",
  19. "application/cdmi-queue": "cdmiq",
  20. "application/cu-seeme": "cu",
  21. "application/davmount+xml": "davmount",
  22. "application/docbook+xml": "dbk",
  23. "application/dssc+der": "dssc",
  24. "application/dssc+xml": "xdssc",
  25. "application/ecmascript": "ecma",
  26. "application/emma+xml": "emma",
  27. "application/epub+zip": "epub",
  28. "application/exi": "exi",
  29. "application/font-tdpfr": "pfr",
  30. "application/gml+xml": "gml",
  31. "application/gpx+xml": "gpx",
  32. "application/gxf": "gxf",
  33. "application/hyperstudio": "stk",
  34. "application/inkml+xml": "ink inkml",
  35. "application/ipfix": "ipfix",
  36. "application/java-archive": "jar",
  37. "application/java-serialized-object": "ser",
  38. "application/java-vm": "class",
  39. "application/javascript": "js",
  40. "application/json": "json",
  41. "application/jsonml+json": "jsonml",
  42. "application/lost+xml": "lostxml",
  43. "application/mac-binhex40": "hqx",
  44. "application/mac-compactpro": "cpt",
  45. "application/mads+xml": "mads",
  46. "application/marc": "mrc",
  47. "application/marcxml+xml": "mrcx",
  48. "application/mathematica": "ma",
  49. "application/mathml+xml": "mathml",
  50. "application/mbox": "mbox",
  51. "application/mediaservercontrol+xml": "mscml",
  52. "application/metalink+xml": "metalink",
  53. "application/metalink4+xml": "meta4",
  54. "application/mets+xml": "mets",
  55. "application/mods+xml": "mods",
  56. "application/mp21": "mp21",
  57. "application/mp4": "mp4s",
  58. "application/msword": "doc",
  59. "application/mxf": "mxf",
  60. "application/octet-stream": "bin",
  61. "application/oda": "oda",
  62. "application/oebps-package+xml": "opf",
  63. "application/ogg": "ogx",
  64. "application/omdoc+xml": "omdoc",
  65. "application/onenote": "onetoc",
  66. "application/oxps": "oxps",
  67. "application/patch-ops-error+xml": "xer",
  68. "application/pdf": "pdf",
  69. "application/pgp-encrypted": "pgp",
  70. "application/pgp-signature": "asc",
  71. "application/pics-rules": "prf",
  72. "application/pkcs10": "p10",
  73. "application/pkcs7-mime": "p7m",
  74. "application/pkcs7-signature": "p7s",
  75. "application/pkcs8": "p8",
  76. "application/pkix-attr-cert": "ac",
  77. "application/pkix-cert": "cer",
  78. "application/pkix-crl": "crl",
  79. "application/pkix-pkipath": "pkipath",
  80. "application/pkixcmp": "pki",
  81. "application/pls+xml": "pls",
  82. "application/postscript": "ps",
  83. "application/prs.cww": "cww",
  84. "application/pskc+xml": "pskcxml",
  85. "application/rdf+xml": "rdf",
  86. "application/reginfo+xml": "rif",
  87. "application/relax-ng-compact-syntax": "rnc",
  88. "application/resource-lists+xml": "rl",
  89. "application/resource-lists-diff+xml": "rld",
  90. "application/rls-services+xml": "rs",
  91. "application/rpki-ghostbusters": "gbr",
  92. "application/rpki-manifest": "mft",
  93. "application/rpki-roa": "roa",
  94. "application/rsd+xml": "rsd",
  95. "application/rss+xml": "rss",
  96. "application/rtf": "rtf",
  97. "application/sbml+xml": "sbml",
  98. "application/scvp-cv-request": "scq",
  99. "application/scvp-cv-response": "scs",
  100. "application/scvp-vp-request": "spq",
  101. "application/scvp-vp-response": "spp",
  102. "application/sdp": "sdp",
  103. "application/set-payment-initiation": "setpay",
  104. "application/set-registration-initiation": "setreg",
  105. "application/shf+xml": "shf",
  106. "application/smil+xml": "smil",
  107. "application/sparql-query": "rq",
  108. "application/sparql-results+xml": "srx",
  109. "application/srgs": "gram",
  110. "application/srgs+xml": "grxml",
  111. "application/sru+xml": "sru",
  112. "application/ssdl+xml": "ssdl",
  113. "application/ssml+xml": "ssml",
  114. "application/tei+xml": "tei",
  115. "application/thraud+xml": "tfi",
  116. "application/timestamped-data": "tsd",
  117. "application/vnd.3gpp.pic-bw-large": "plb",
  118. "application/vnd.3gpp.pic-bw-small": "psb",
  119. "application/vnd.3gpp.pic-bw-var": "pvb",
  120. "application/vnd.3gpp2.tcap": "tcap",
  121. "application/vnd.3m.post-it-notes": "pwn",
  122. "application/vnd.accpac.simply.aso": "aso",
  123. "application/vnd.accpac.simply.imp": "imp",
  124. "application/vnd.acucobol": "acu",
  125. "application/vnd.acucorp": "atc acutc",
  126. "application/vnd.adobe.air-application-installer-package+zip": "air",
  127. "application/vnd.adobe.formscentral.fcdt": "fcdt",
  128. "application/vnd.adobe.fxp": "fxp",
  129. "application/vnd.adobe.xdp+xml": "xdp",
  130. "application/vnd.adobe.xfdf": "xfdf",
  131. "application/vnd.ahead.space": "ahead",
  132. "application/vnd.airzip.filesecure.azf": "azf",
  133. "application/vnd.airzip.filesecure.azs": "azs",
  134. "application/vnd.amazon.ebook": "azw",
  135. "application/vnd.americandynamics.acc": "acc",
  136. "application/vnd.amiga.ami": "ami",
  137. "application/vnd.android.package-archive": "apk",
  138. "application/vnd.anser-web-certificate-issue-initiation": "cii",
  139. "application/vnd.anser-web-funds-transfer-initiation": "fti",
  140. "application/vnd.antix.game-component": "atx",
  141. "application/vnd.apple.installer+xml": "mpkg",
  142. "application/vnd.apple.mpegurl": "m3u8",
  143. "application/vnd.aristanetworks.swi": "swi",
  144. "application/vnd.astraea-software.iota": "iota",
  145. "application/vnd.audiograph": "aep",
  146. "application/vnd.blueice.multipass": "mpm",
  147. "application/vnd.bmi": "bmi",
  148. "application/vnd.businessobjects": "rep",
  149. "application/vnd.chemdraw+xml": "cdxml",
  150. "application/vnd.chipnuts.karaoke-mmd": "mmd",
  151. "application/vnd.cinderella": "cdy",
  152. "application/vnd.claymore": "cla",
  153. "application/vnd.cloanto.rp9": "rp9",
  154. "application/vnd.clonk.c4group": "c4g",
  155. "application/vnd.cluetrust.cartomobile-config": "c11amc",
  156. "application/vnd.cluetrust.cartomobile-config-pkg": "c11amz",
  157. "application/vnd.commonspace": "csp",
  158. "application/vnd.contact.cmsg": "cdbcmsg",
  159. "application/vnd.cosmocaller": "cmc",
  160. "application/vnd.crick.clicker": "clkx",
  161. "application/vnd.crick.clicker.keyboard": "clkk",
  162. "application/vnd.crick.clicker.palette": "clkp",
  163. "application/vnd.crick.clicker.template": "clkt",
  164. "application/vnd.crick.clicker.wordbank": "clkw",
  165. "application/vnd.criticaltools.wbs+xml": "wbs",
  166. "application/vnd.ctc-posml": "pml",
  167. "application/vnd.cups-ppd": "ppd",
  168. "application/vnd.curl.car": "car",
  169. "application/vnd.curl.pcurl": "pcurl",
  170. "application/vnd.dart": "dart",
  171. "application/vnd.data-vision.rdz": "rdz",
  172. "application/vnd.dece.data": "uvf",
  173. "application/vnd.dece.ttml+xml": "uvt",
  174. "application/vnd.dece.unspecified": "uvx",
  175. "application/vnd.dece.zip": "uvz",
  176. "application/vnd.denovo.fcselayout-link": "fe_launch",
  177. "application/vnd.dna": "dna",
  178. "application/vnd.dolby.mlp": "mlp",
  179. "application/vnd.dpgraph": "dpg",
  180. "application/vnd.dreamfactory": "dfac",
  181. "application/vnd.ds-keypoint": "kpxx",
  182. "application/vnd.dvb.ait": "ait",
  183. "application/vnd.dvb.service": "svc",
  184. "application/vnd.dynageo": "geo",
  185. "application/vnd.ecowin.chart": "mag",
  186. "application/vnd.enliven": "nml",
  187. "application/vnd.epson.esf": "esf",
  188. "application/vnd.epson.msf": "msf",
  189. "application/vnd.epson.quickanime": "qam",
  190. "application/vnd.epson.salt": "slt",
  191. "application/vnd.epson.ssf": "ssf",
  192. "application/vnd.eszigno3+xml": "es3",
  193. "application/vnd.ezpix-album": "ez2",
  194. "application/vnd.ezpix-package": "ez3",
  195. "application/vnd.fdf": "fdf",
  196. "application/vnd.fdsn.mseed": "mseed",
  197. "application/vnd.fdsn.seed": "seed",
  198. "application/vnd.flographit": "gph",
  199. "application/vnd.fluxtime.clip": "ftc",
  200. "application/vnd.framemaker": "fm",
  201. "application/vnd.frogans.fnc": "fnc",
  202. "application/vnd.frogans.ltf": "ltf",
  203. "application/vnd.fsc.weblaunch": "fsc",
  204. "application/vnd.fujitsu.oasys": "oas",
  205. "application/vnd.fujitsu.oasys2": "oa2",
  206. "application/vnd.fujitsu.oasys3": "oa3",
  207. "application/vnd.fujitsu.oasysgp": "fg5",
  208. "application/vnd.fujitsu.oasysprs": "bh2",
  209. "application/vnd.fujixerox.ddd": "ddd",
  210. "application/vnd.fujixerox.docuworks": "xdw",
  211. "application/vnd.fujixerox.docuworks.binder": "xbd",
  212. "application/vnd.fuzzysheet": "fzs",
  213. "application/vnd.genomatix.tuxedo": "txd",
  214. "application/vnd.geogebra.file": "ggb",
  215. "application/vnd.geogebra.tool": "ggt",
  216. "application/vnd.geometry-explorer": "gex gre",
  217. "application/vnd.geonext": "gxt",
  218. "application/vnd.geoplan": "g2w",
  219. "application/vnd.geospace": "g3w",
  220. "application/vnd.gmx": "gmx",
  221. "application/vnd.google-earth.kml+xml": "kml",
  222. "application/vnd.google-earth.kmz": "kmz",
  223. "application/vnd.grafeq": "gqf gqs",
  224. "application/vnd.groove-account": "gac",
  225. "application/vnd.groove-help": "ghf",
  226. "application/vnd.groove-identity-message": "gim",
  227. "application/vnd.groove-injector": "grv",
  228. "application/vnd.groove-tool-message": "gtm",
  229. "application/vnd.groove-tool-template": "tpl",
  230. "application/vnd.groove-vcard": "vcg",
  231. "application/vnd.hal+xml": "hal",
  232. "application/vnd.handheld-entertainment+xml": "zmm",
  233. "application/vnd.hbci": "hbci",
  234. "application/vnd.hhe.lesson-player": "les",
  235. "application/vnd.hp-hpgl": "hpgl",
  236. "application/vnd.hp-hpid": "hpid",
  237. "application/vnd.hp-hps": "hps",
  238. "application/vnd.hp-jlyt": "jlt",
  239. "application/vnd.hp-pcl": "pcl",
  240. "application/vnd.hp-pclxl": "pclxl",
  241. "application/vnd.hydrostatix.sof-data": "sfd-hdstx",
  242. "application/vnd.ibm.minipay": "mpy",
  243. "application/vnd.ibm.modcap": "afp",
  244. "application/vnd.ibm.rights-management": "irm",
  245. "application/vnd.ibm.secure-container": "sc",
  246. "application/vnd.iccprofile": "icc icm",
  247. "application/vnd.igloader": "igl",
  248. "application/vnd.immervision-ivp": "ivp",
  249. "application/vnd.immervision-ivu": "ivu",
  250. "application/vnd.insors.igm": "igm",
  251. "application/vnd.intercon.formnet": "xpw",
  252. "application/vnd.intergeo": "i2g",
  253. "application/vnd.intu.qbo": "qbo",
  254. "application/vnd.intu.qfx": "qfx",
  255. "application/vnd.ipunplugged.rcprofile": "rcprofile",
  256. "application/vnd.irepository.package+xml": "irp",
  257. "application/vnd.is-xpr": "xpr",
  258. "application/vnd.isac.fcs": "fcs",
  259. "application/vnd.jam": "jam",
  260. "application/vnd.jcp.javame.midlet-rms": "rms",
  261. "application/vnd.jisp": "jisp",
  262. "application/vnd.joost.joda-archive": "joda",
  263. "application/vnd.kahootz": "ktz",
  264. "application/vnd.kde.karbon": "karbon",
  265. "application/vnd.kde.kchart": "chrt",
  266. "application/vnd.kde.kformula": "kfo",
  267. "application/vnd.kde.kivio": "flw",
  268. "application/vnd.kde.kontour": "kon",
  269. "application/vnd.kde.kpresenter": "kpr",
  270. "application/vnd.kde.kspread": "ksp",
  271. "application/vnd.kde.kword": "kwd",
  272. "application/vnd.kenameaapp": "htke",
  273. "application/vnd.kidspiration": "kia",
  274. "application/vnd.kinar": "kne knp",
  275. "application/vnd.koan": "skp",
  276. "application/vnd.kodak-descriptor": "sse",
  277. "application/vnd.las.las+xml": "lasxml",
  278. "application/vnd.llamagraphics.life-balance.desktop": "lbd",
  279. "application/vnd.llamagraphics.life-balance.exchange+xml": "lbe",
  280. "application/vnd.lotus-1-2-3": "123",
  281. "application/vnd.lotus-approach": "apr",
  282. "application/vnd.lotus-freelance": "pre",
  283. "application/vnd.lotus-notes": "nsf",
  284. "application/vnd.lotus-organizer": "org",
  285. "application/vnd.lotus-screencam": "scm",
  286. "application/vnd.lotus-wordpro": "lwp",
  287. "application/vnd.macports.portpkg": "portpkg",
  288. "application/vnd.mcd": "mcd",
  289. "application/vnd.medcalcdata": "mc1",
  290. "application/vnd.mediastation.cdkey": "cdkey",
  291. "application/vnd.mfer": "mwf",
  292. "application/vnd.mfmp": "mfm",
  293. "application/vnd.micrografx.flo": "flo",
  294. "application/vnd.micrografx.igx": "igx",
  295. "application/vnd.mif": "mif",
  296. "application/vnd.mobius.daf": "daf",
  297. "application/vnd.mobius.dis": "dis",
  298. "application/vnd.mobius.mbk": "mbk",
  299. "application/vnd.mobius.mqy": "mqy",
  300. "application/vnd.mobius.msl": "msl",
  301. "application/vnd.mobius.plc": "plc",
  302. "application/vnd.mobius.txf": "txf",
  303. "application/vnd.mophun.application": "mpn",
  304. "application/vnd.mophun.certificate": "mpc",
  305. "application/vnd.mozilla.xul+xml": "xul",
  306. "application/vnd.ms-artgalry": "cil",
  307. "application/vnd.ms-cab-compressed": "cab",
  308. "application/vnd.ms-excel": "xls",
  309. "application/vnd.ms-excel.addin.macroenabled.12": "xlam",
  310. "application/vnd.ms-excel.sheet.binary.macroenabled.12": "xlsb",
  311. "application/vnd.ms-excel.sheet.macroenabled.12": "xlsm",
  312. "application/vnd.ms-excel.template.macroenabled.12": "xltm",
  313. "application/vnd.ms-fontobject": "eot",
  314. "application/vnd.ms-htmlhelp": "chm",
  315. "application/vnd.ms-ims": "ims",
  316. "application/vnd.ms-lrm": "lrm",
  317. "application/vnd.ms-officetheme": "thmx",
  318. "application/vnd.ms-pki.seccat": "cat",
  319. "application/vnd.ms-pki.stl": "stl",
  320. "application/vnd.ms-powerpoint": "ppt pps pot",
  321. "application/vnd.ms-powerpoint.addin.macroenabled.12": "ppam",
  322. "application/vnd.ms-powerpoint.presentation.macroenabled.12": "pptm",
  323. "application/vnd.ms-powerpoint.slide.macroenabled.12": "sldm",
  324. "application/vnd.ms-powerpoint.slideshow.macroenabled.12": "ppsm",
  325. "application/vnd.ms-powerpoint.template.macroenabled.12": "potm",
  326. "application/vnd.ms-project": "mpp mpt",
  327. "application/vnd.ms-word.document.macroenabled.12": "docm",
  328. "application/vnd.ms-word.template.macroenabled.12": "dotm",
  329. "application/vnd.ms-works": "wps",
  330. "application/vnd.ms-wpl": "wpl",
  331. "application/vnd.ms-xpsdocument": "xps",
  332. "application/vnd.mseq": "mseq",
  333. "application/vnd.musician": "mus",
  334. "application/vnd.muvee.style": "msty",
  335. "application/vnd.mynfc": "taglet",
  336. "application/vnd.neurolanguage.nlu": "nlu",
  337. "application/vnd.nitf": "ntf nitf",
  338. "application/vnd.noblenet-directory": "nnd",
  339. "application/vnd.noblenet-sealer": "nns",
  340. "application/vnd.noblenet-web": "nnw",
  341. "application/vnd.nokia.n-gage.data": "ngdat",
  342. "application/vnd.nokia.n-gage.symbian.install": "n-gage",
  343. "application/vnd.nokia.radio-preset": "rpst",
  344. "application/vnd.nokia.radio-presets": "rpss",
  345. "application/vnd.novadigm.edm": "edm",
  346. "application/vnd.novadigm.edx": "edx",
  347. "application/vnd.novadigm.ext": "ext",
  348. "application/vnd.oasis.opendocument.chart": "odc",
  349. "application/vnd.oasis.opendocument.chart-template": "otc",
  350. "application/vnd.oasis.opendocument.database": "odb",
  351. "application/vnd.oasis.opendocument.formula": "odf",
  352. "application/vnd.oasis.opendocument.formula-template": "odft",
  353. "application/vnd.oasis.opendocument.graphics": "odg",
  354. "application/vnd.oasis.opendocument.graphics-template": "otg",
  355. "application/vnd.oasis.opendocument.image": "odi",
  356. "application/vnd.oasis.opendocument.image-template": "oti",
  357. "application/vnd.oasis.opendocument.presentation": "odp",
  358. "application/vnd.oasis.opendocument.presentation-template": "otp",
  359. "application/vnd.oasis.opendocument.spreadsheet": "ods",
  360. "application/vnd.oasis.opendocument.spreadsheet-template": "ots",
  361. "application/vnd.oasis.opendocument.text": "odt",
  362. "application/vnd.oasis.opendocument.text-master": "odm",
  363. "application/vnd.oasis.opendocument.text-template": "ott",
  364. "application/vnd.oasis.opendocument.text-web": "oth",
  365. "application/vnd.olpc-sugar": "xo",
  366. "application/vnd.oma.dd2+xml": "dd2",
  367. "application/vnd.openofficeorg.extension": "oxt",
  368. "application/vnd.openxmlformats-officedocument.presentationml.presentation": "pptx",
  369. "application/vnd.openxmlformats-officedocument.presentationml.slide": "sldx",
  370. "application/vnd.openxmlformats-officedocument.presentationml.slideshow": "ppsx",
  371. "application/vnd.openxmlformats-officedocument.presentationml.template": "potx",
  372. "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": "xlsx",
  373. "application/vnd.openxmlformats-officedocument.spreadsheetml.template": "xltx",
  374. "application/vnd.openxmlformats-officedocument.wordprocessingml.document": "docx",
  375. "application/vnd.openxmlformats-officedocument.wordprocessingml.template": "dotx",
  376. "application/vnd.osgeo.mapguide.package": "mgp",
  377. "application/vnd.osgi.dp": "dp",
  378. "application/vnd.osgi.subsystem": "esa",
  379. "application/vnd.palm": "pdb pqa oprc",
  380. "application/vnd.pawaafile": "paw",
  381. "application/vnd.pg.format": "str",
  382. "application/vnd.pg.osasli": "ei6",
  383. "application/vnd.picsel": "efif",
  384. "application/vnd.pmi.widget": "wg",
  385. "application/vnd.pocketlearn": "plf",
  386. "application/vnd.powerbuilder6": "pbd",
  387. "application/vnd.previewsystems.box": "box",
  388. "application/vnd.proteus.magazine": "mgz",
  389. "application/vnd.publishare-delta-tree": "qps",
  390. "application/vnd.pvi.ptid1": "ptid",
  391. "application/vnd.quark.quarkxpress": "qxd",
  392. "application/vnd.realvnc.bed": "bed",
  393. "application/vnd.recordare.musicxml": "mxl",
  394. "application/vnd.recordare.musicxml+xml": "musicxml",
  395. "application/vnd.rig.cryptonote": "cryptonote",
  396. "application/vnd.rim.cod": "cod",
  397. "application/vnd.rn-realmedia": "rm",
  398. "application/vnd.rn-realmedia-vbr": "rmvb",
  399. "application/vnd.route66.link66+xml": "link66",
  400. "application/vnd.sailingtracker.track": "st",
  401. "application/vnd.seemail": "see",
  402. "application/vnd.sema": "sema",
  403. "application/vnd.semd": "semd",
  404. "application/vnd.semf": "semf",
  405. "application/vnd.shana.informed.formdata": "ifm",
  406. "application/vnd.shana.informed.formtemplate": "itp",
  407. "application/vnd.shana.informed.interchange": "iif",
  408. "application/vnd.shana.informed.package": "ipk",
  409. "application/vnd.simtech-mindmapper": "twd",
  410. "application/vnd.smaf": "mmf",
  411. "application/vnd.smart.teacher": "teacher",
  412. "application/vnd.solent.sdkm+xml": "sdkm",
  413. "application/vnd.spotfire.dxp": "dxp",
  414. "application/vnd.spotfire.sfs": "sfs",
  415. "application/vnd.stardivision.calc": "sdc",
  416. "application/vnd.stardivision.draw": "sda",
  417. "application/vnd.stardivision.impress": "sdd",
  418. "application/vnd.stardivision.math": "smf",
  419. "application/vnd.stardivision.writer": "sdw",
  420. "application/vnd.stardivision.writer-global": "sgl",
  421. "application/vnd.stepmania.package": "smzip",
  422. "application/vnd.stepmania.stepchart": "sm",
  423. "application/vnd.sun.xml.calc": "sxc",
  424. "application/vnd.sun.xml.calc.template": "stc",
  425. "application/vnd.sun.xml.draw": "sxd",
  426. "application/vnd.sun.xml.draw.template": "std",
  427. "application/vnd.sun.xml.impress": "sxi",
  428. "application/vnd.sun.xml.impress.template": "sti",
  429. "application/vnd.sun.xml.math": "sxm",
  430. "application/vnd.sun.xml.writer": "sxw",
  431. "application/vnd.sun.xml.writer.global": "sxg",
  432. "application/vnd.sun.xml.writer.template": "stw",
  433. "application/vnd.sus-calendar": "sus",
  434. "application/vnd.svd": "svd",
  435. "application/vnd.symbian.install": "sis",
  436. "application/vnd.syncml+xml": "xsm",
  437. "application/vnd.syncml.dm+wbxml": "bdm",
  438. "application/vnd.syncml.dm+xml": "xdm",
  439. "application/vnd.tao.intent-module-archive": "tao",
  440. "application/vnd.tcpdump.pcap": "pcap",
  441. "application/vnd.tmobile-livetv": "tmo",
  442. "application/vnd.trid.tpt": "tpt",
  443. "application/vnd.triscape.mxs": "mxs",
  444. "application/vnd.trueapp": "tra",
  445. "application/vnd.ufdl": "ufdl",
  446. "application/vnd.uiq.theme": "utz",
  447. "application/vnd.umajin": "umj",
  448. "application/vnd.unity": "unityweb",
  449. "application/vnd.uoml+xml": "uoml",
  450. "application/vnd.vcx": "vcx",
  451. "application/vnd.visio": "vsd",
  452. "application/vnd.visionary": "vis",
  453. "application/vnd.vsf": "vsf",
  454. "application/vnd.wap.wbxml": "wbxml",
  455. "application/vnd.wap.wmlc": "wmlc",
  456. "application/vnd.wap.wmlscriptc": "wmlsc",
  457. "application/vnd.webturbo": "wtb",
  458. "application/vnd.wolfram.player": "nbp",
  459. "application/vnd.wordperfect": "wpd",
  460. "application/vnd.wqd": "wqd",
  461. "application/vnd.wt.stf": "stf",
  462. "application/vnd.xara": "xar",
  463. "application/vnd.xfdl": "xfdl",
  464. "application/vnd.yamaha.hv-dic": "hvd",
  465. "application/vnd.yamaha.hv-script": "hvs",
  466. "application/vnd.yamaha.hv-voice": "hvp",
  467. "application/vnd.yamaha.openscoreformat": "osf",
  468. "application/vnd.yamaha.openscoreformat.osfpvg+xml": "osfpvg",
  469. "application/vnd.yamaha.smaf-audio": "saf",
  470. "application/vnd.yamaha.smaf-phrase": "spf",
  471. "application/vnd.yellowriver-custom-menu": "cmp",
  472. "application/vnd.zul": "zir",
  473. "application/vnd.zzazz.deck+xml": "zaz",
  474. "application/voicexml+xml": "vxml",
  475. "application/widget": "wgt",
  476. "application/winhlp": "hlp",
  477. "application/wsdl+xml": "wsdl",
  478. "application/wspolicy+xml": "wspolicy",
  479. "application/x-7z-compressed": "7z",
  480. "application/x-abiword": "abw",
  481. "application/x-ace-compressed": "ace",
  482. "application/x-apple-diskimage": "dmg",
  483. "application/x-authorware-bin": "aab",
  484. "application/x-authorware-map": "aam",
  485. "application/x-authorware-seg": "aas",
  486. "application/x-bcpio": "bcpio",
  487. "application/x-bittorrent": "torrent",
  488. "application/x-blorb": "blb",
  489. "application/x-bzip": "bz",
  490. "application/x-bzip2": "bz2",
  491. "application/x-cbr": "cbr",
  492. "application/x-cdlink": "vcd",
  493. "application/x-cfs-compressed": "cfs",
  494. "application/x-chat": "chat",
  495. "application/x-chess-pgn": "pgn",
  496. "application/x-conference": "nsc",
  497. "application/x-cpio": "cpio",
  498. "application/x-csh": "csh",
  499. "application/x-debian-package": "deb",
  500. "application/x-dgc-compressed": "dgc",
  501. "application/x-director": "dir",
  502. "application/x-doom": "wad",
  503. "application/x-dtbncx+xml": "ncx",
  504. "application/x-dtbook+xml": "dtb",
  505. "application/x-dtbresource+xml": "res",
  506. "application/x-dvi": "dvi",
  507. "application/x-envoy": "evy",
  508. "application/x-eva": "eva",
  509. "application/x-font-bdf": "bdf",
  510. "application/x-font-ghostscript": "gsf",
  511. "application/x-font-linux-psf": "psf",
  512. "application/x-font-otf": "otf",
  513. "application/x-font-pcf": "pcf",
  514. "application/x-font-snf": "snf",
  515. "application/x-font-ttf": "ttf",
  516. "application/x-font-type1": "pfa",
  517. "application/x-font-woff": "woff",
  518. "application/x-freearc": "arc",
  519. "application/x-futuresplash": "spl",
  520. "application/x-gca-compressed": "gca",
  521. "application/x-glulx": "ulx",
  522. "application/x-gnumeric": "gnumeric",
  523. "application/x-gramps-xml": "gramps",
  524. "application/x-gtar": "gtar",
  525. "application/x-hdf": "hdf",
  526. "application/x-install-instructions": "install",
  527. "application/x-iso9660-image": "iso",
  528. "application/x-java-jnlp-file": "jnlp",
  529. "application/x-latex": "latex",
  530. "application/x-lzh-compressed": "lzh",
  531. "application/x-mie": "mie",
  532. "application/x-mobipocket-ebook": "prc",
  533. "application/x-ms-application": "application",
  534. "application/x-ms-shortcut": "lnk",
  535. "application/x-ms-wmd": "wmd",
  536. "application/x-ms-wmz": "wmz",
  537. "application/x-ms-xbap": "xbap",
  538. "application/x-msaccess": "mdb",
  539. "application/x-msbinder": "obd",
  540. "application/x-mscardfile": "crd",
  541. "application/x-msclip": "clp",
  542. "application/x-msdownload": "exe",
  543. "application/x-msmediaview": "mvb",
  544. "application/x-msmetafile": "wmf",
  545. "application/x-msmoney": "mny",
  546. "application/x-mspublisher": "pub",
  547. "application/x-msschedule": "scd",
  548. "application/x-msterminal": "trm",
  549. "application/x-mswrite": "wri",
  550. "application/x-netcdf": "nc",
  551. "application/x-nzb": "nzb",
  552. "application/x-pkcs12": "p12",
  553. "application/x-pkcs7-certificates": "p7b",
  554. "application/x-pkcs7-certreqresp": "p7r",
  555. "application/x-rar-compressed": "rar",
  556. "application/x-research-info-systems": "ris",
  557. "application/x-sh": "sh",
  558. "application/x-shar": "shar",
  559. "application/x-shockwave-flash": "swf",
  560. "application/x-silverlight-app": "xap",
  561. "application/x-sql": "sql",
  562. "application/x-stuffit": "sit",
  563. "application/x-stuffitx": "sitx",
  564. "application/x-subrip": "srt",
  565. "application/x-sv4cpio": "sv4cpio",
  566. "application/x-sv4crc": "sv4crc",
  567. "application/x-t3vm-image": "t3",
  568. "application/x-tads": "gam",
  569. "application/x-tar": "tar",
  570. "application/x-tcl": "tcl",
  571. "application/x-tex": "tex",
  572. "application/x-tex-tfm": "tfm",
  573. "application/x-texinfo": "texinfo",
  574. "application/x-tgif": "obj",
  575. "application/x-ustar": "ustar",
  576. "application/x-wais-source": "src",
  577. "application/x-x509-ca-cert": "der",
  578. "application/x-xfig": "fig",
  579. "application/x-xliff+xml": "xlf",
  580. "application/x-xpinstall": "xpi",
  581. "application/x-xz": "xz",
  582. "application/x-zmachine": "z1",
  583. "application/xaml+xml": "xaml",
  584. "application/xcap-diff+xml": "xdf",
  585. "application/xenc+xml": "xenc",
  586. "application/xhtml+xml": "xhtml",
  587. "application/xml": "xml",
  588. "application/xml-dtd": "dtd",
  589. "application/xop+xml": "xop",
  590. "application/xproc+xml": "xpl",
  591. "application/xslt+xml": "xslt",
  592. "application/xspf+xml": "xspf",
  593. "application/xv+xml": "mxml",
  594. "application/yang": "yang",
  595. "application/yin+xml": "yin",
  596. "application/zip": "zip",
  597. "audio/adpcm": "adp",
  598. "audio/basic": "au",
  599. "audio/midi": "mid",
  600. "audio/mp4": "mp4a",
  601. "audio/mpeg": "mpga",
  602. "audio/ogg": "oga",
  603. "audio/s3m": "s3m",
  604. "audio/silk": "sil",
  605. "audio/vnd.dece.audio": "uva",
  606. "audio/vnd.digital-winds": "eol",
  607. "audio/vnd.dra": "dra",
  608. "audio/vnd.dts": "dts",
  609. "audio/vnd.dts.hd": "dtshd",
  610. "audio/vnd.lucent.voice": "lvp",
  611. "audio/vnd.ms-playready.media.pya": "pya",
  612. "audio/vnd.nuera.ecelp4800": "ecelp4800",
  613. "audio/vnd.nuera.ecelp7470": "ecelp7470",
  614. "audio/vnd.nuera.ecelp9600": "ecelp9600",
  615. "audio/vnd.rip": "rip",
  616. "audio/webm": "weba",
  617. "audio/x-aac": "aac",
  618. "audio/x-aiff": "aif",
  619. "audio/x-caf": "caf",
  620. "audio/x-flac": "flac",
  621. "audio/x-matroska": "mka",
  622. "audio/x-mpegurl": "m3u",
  623. "audio/x-ms-wax": "wax",
  624. "audio/x-ms-wma": "wma",
  625. "audio/x-pn-realaudio": "ram",
  626. "audio/x-pn-realaudio-plugin": "rmp",
  627. "audio/x-wav": "wav",
  628. "audio/xm": "xm",
  629. "chemical/x-cdx": "cdx",
  630. "chemical/x-cif": "cif",
  631. "chemical/x-cmdf": "cmdf",
  632. "chemical/x-cml": "cml",
  633. "chemical/x-csml": "csml",
  634. "chemical/x-xyz": "xyz",
  635. "image/bmp": "bmp",
  636. "image/cgm": "cgm",
  637. "image/g3fax": "g3",
  638. "image/gif": "gif",
  639. "image/ief": "ief",
  640. "image/jpeg": "jpeg",
  641. "image/ktx": "ktx",
  642. "image/png": "png",
  643. "image/prs.btif": "btif",
  644. "image/sgi": "sgi",
  645. "image/svg+xml": "svg svgz",
  646. "image/tiff": "tiff tif",
  647. "image/vnd.adobe.photoshop": "psd",
  648. "image/vnd.dece.graphic": "uvi",
  649. "image/vnd.dvb.subtitle": "sub",
  650. "image/vnd.djvu": "djvu",
  651. "image/vnd.dwg": "dwg",
  652. "image/vnd.dxf": "dxf",
  653. "image/vnd.fastbidsheet": "fbs",
  654. "image/vnd.fpx": "fpx",
  655. "image/vnd.fst": "fst",
  656. "image/vnd.fujixerox.edmics-mmr": "mmr",
  657. "image/vnd.fujixerox.edmics-rlc": "rlc",
  658. "image/vnd.ms-modi": "mdi",
  659. "image/vnd.ms-photo": "wdp",
  660. "image/vnd.net-fpx": "npx",
  661. "image/vnd.wap.wbmp": "wbmp",
  662. "image/vnd.xiff": "xif",
  663. "image/webp": "webp",
  664. "image/x-3ds": "3ds",
  665. "image/x-cmu-raster": "ras",
  666. "image/x-cmx": "cmx",
  667. "image/x-freehand": "fh",
  668. "image/x-icon": "ico",
  669. "image/x-mrsid-image": "sid",
  670. "image/x-pcx": "pcx",
  671. "image/x-pict": "pic",
  672. "image/x-portable-anymap": "pnm",
  673. "image/x-portable-bitmap": "pbm",
  674. "image/x-portable-graymap": "pgm",
  675. "image/x-portable-pixmap": "ppm",
  676. "image/x-rgb": "rgb",
  677. "image/x-tga": "tga",
  678. "image/x-xbitmap": "xbm",
  679. "image/x-xpixmap": "xpm",
  680. "image/x-xwindowdump": "xwd",
  681. "message/rfc822": "eml mime",
  682. "model/iges": "igs",
  683. "model/mesh": "mesh",
  684. "model/vnd.collada+xml": "dae",
  685. "model/vnd.dwf": "dwf",
  686. "model/vnd.gdl": "gdl",
  687. "model/vnd.gtw": "gtw",
  688. "model/vnd.mts": "mts",
  689. "model/vnd.vtu": "vtu",
  690. "model/vrml": "wrl vrml",
  691. "model/x3d+binary": "x3db",
  692. "model/x3d+vrml": "x3dv",
  693. "model/x3d+xml": "x3d",
  694. "text/cache-manifest": "appcache",
  695. "text/calendar": "ics ifb",
  696. "text/css": "css",
  697. "text/csv": "csv",
  698. "text/html": "html",
  699. "text/n3": "n3",
  700. "text/plain": "txt",
  701. "text/prs.lines.tag": "dsc",
  702. "text/richtext": "rtx",
  703. "text/sgml": "sgml sgm",
  704. "text/tab-separated-values": "tsv",
  705. "text/troff": "t",
  706. "text/turtle": "ttl",
  707. "text/uri-list": "uri",
  708. "text/vcard": "vcard",
  709. "text/vnd.curl": "curl",
  710. "text/vnd.curl.dcurl": "dcurl",
  711. "text/vnd.curl.scurl": "scurl",
  712. "text/vnd.curl.mcurl": "mcurl",
  713. "text/vnd.dvb.subtitle": "sub",
  714. "text/vnd.fly": "fly",
  715. "text/vnd.fmi.flexstor": "flx",
  716. "text/vnd.graphviz": "gv",
  717. "text/vnd.in3d.3dml": "3dml",
  718. "text/vnd.in3d.spot": "spot",
  719. "text/vnd.sun.j2me.app-descriptor": "jad",
  720. "text/vnd.wap.wml": "wml",
  721. "text/vnd.wap.wmlscript": "wmls",
  722. "text/x-asm": "s asm",
  723. "text/x-c": "c",
  724. "text/x-fortran": "f",
  725. "text/x-java-source": "java",
  726. "text/x-opml": "opml",
  727. "text/x-pascal": "p pas",
  728. "text/x-nfo": "nfo",
  729. "text/x-shellscript": "sh",
  730. "text/x-setext": "etx",
  731. "text/x-sfv": "sfv",
  732. "text/x-tex": "tex",
  733. "text/x-uuencode": "uu",
  734. "text/x-vcalendar": "vcs",
  735. "text/x-vcard": "vcf",
  736. "video/3gpp": "3gp",
  737. "video/3gpp2": "3g2",
  738. "video/h261": "h261",
  739. "video/h263": "h263",
  740. "video/h264": "h264",
  741. "video/jpeg": "jpgv",
  742. "video/jpm": "jpm",
  743. "video/mj2": "mj2",
  744. "video/mp4": "mp4",
  745. "video/mpeg": "mpeg",
  746. "video/ogg": "ogv",
  747. "video/quicktime": "qt",
  748. "video/vnd.dece.hd": "uvh",
  749. "video/vnd.dece.mobile": "uvm",
  750. "video/vnd.dece.pd": "uvp",
  751. "video/vnd.dece.sd": "uvs",
  752. "video/vnd.dece.video": "uvv",
  753. "video/vnd.dvb.file": "dvb",
  754. "video/vnd.fvt": "fvt",
  755. "video/vnd.mpegurl": "m4u",
  756. "video/vnd.ms-playready.media.pyv": "pyv",
  757. "video/vnd.uvvu.mp4": "uvvu",
  758. "video/vnd.vivo": "viv",
  759. "video/webm": "webm",
  760. "video/x-f4v": "f4v",
  761. "video/x-fli": "fli",
  762. "video/x-flv": "flv",
  763. "video/x-m4v": "m4v",
  764. "video/x-matroska": "mkv",
  765. "video/x-mng": "mng",
  766. "video/x-ms-asf": "asf",
  767. "video/x-ms-vob": "vob",
  768. "video/x-ms-wm": "wm",
  769. "video/x-ms-wmv": "wmv",
  770. "video/x-ms-wmx": "wmx",
  771. "video/x-ms-wvx": "wvx",
  772. "video/x-msvideo": "avi",
  773. "video/x-sgi-movie": "movie",
  774. "video/x-smv": "smv",
  775. "x-conference/x-cooltalk": "ice",
  776. }
  777. const letterBytes = "abcdefghijklmnopqrstuvwxyz1234567890"
  778. const (
  779. letterIdxBits = 6 // 6 bits to represent a letter index
  780. letterIdxMask = 1<<letterIdxBits - 1 // All 1-bits, as many as letterIdxBits
  781. letterIdxMax = 63 / letterIdxBits // # of letter indices fitting in 63 bits
  782. )
  783. func randomString(n int) string {
  784. b := make([]byte, n)
  785. // A src.Int63() generates 63 random bits, enough for letterIdxMax characters!
  786. for i, cache, remain := n-1, src.Int63(), letterIdxMax; i >= 0; {
  787. if remain == 0 {
  788. cache, remain = src.Int63(), letterIdxMax
  789. }
  790. if idx := int(cache & letterIdxMask); idx < len(letterBytes) {
  791. b[i] = letterBytes[idx]
  792. i--
  793. }
  794. cache >>= letterIdxBits
  795. remain--
  796. }
  797. return string(b)
  798. }