resources.go 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  1. // Code generated by "esc -pkg resources -o resources.go public/ templates/"; DO NOT EDIT.
  2. package internal
  3. import (
  4. "bytes"
  5. "compress/gzip"
  6. "encoding/base64"
  7. "io/ioutil"
  8. "net/http"
  9. "os"
  10. "path"
  11. "sync"
  12. "time"
  13. )
  14. type _escLocalFS struct{}
  15. var _escLocal _escLocalFS
  16. type _escStaticFS struct{}
  17. var _escStatic _escStaticFS
  18. type _escDirectory struct {
  19. fs http.FileSystem
  20. name string
  21. }
  22. type _escFile struct {
  23. compressed string
  24. size int64
  25. modtime int64
  26. local string
  27. isDir bool
  28. once sync.Once
  29. data []byte
  30. name string
  31. }
  32. func (_escLocalFS) Open(name string) (http.File, error) {
  33. f, present := _escData[path.Clean(name)]
  34. if !present {
  35. return nil, os.ErrNotExist
  36. }
  37. return os.Open(f.local)
  38. }
  39. func (_escStaticFS) prepare(name string) (*_escFile, error) {
  40. f, present := _escData[path.Clean(name)]
  41. if !present {
  42. return nil, os.ErrNotExist
  43. }
  44. var err error
  45. f.once.Do(func() {
  46. f.name = path.Base(name)
  47. if f.size == 0 {
  48. return
  49. }
  50. var gr *gzip.Reader
  51. b64 := base64.NewDecoder(base64.StdEncoding, bytes.NewBufferString(f.compressed))
  52. gr, err = gzip.NewReader(b64)
  53. if err != nil {
  54. return
  55. }
  56. f.data, err = ioutil.ReadAll(gr)
  57. })
  58. if err != nil {
  59. return nil, err
  60. }
  61. return f, nil
  62. }
  63. func (fs _escStaticFS) Open(name string) (http.File, error) {
  64. f, err := fs.prepare(name)
  65. if err != nil {
  66. return nil, err
  67. }
  68. return f.File()
  69. }
  70. func (dir _escDirectory) Open(name string) (http.File, error) {
  71. return dir.fs.Open(dir.name + name)
  72. }
  73. func (f *_escFile) File() (http.File, error) {
  74. type httpFile struct {
  75. *bytes.Reader
  76. *_escFile
  77. }
  78. return &httpFile{
  79. Reader: bytes.NewReader(f.data),
  80. _escFile: f,
  81. }, nil
  82. }
  83. func (f *_escFile) Close() error {
  84. return nil
  85. }
  86. func (f *_escFile) Readdir(count int) ([]os.FileInfo, error) {
  87. return nil, nil
  88. }
  89. func (f *_escFile) Stat() (os.FileInfo, error) {
  90. return f, nil
  91. }
  92. func (f *_escFile) Name() string {
  93. return f.name
  94. }
  95. func (f *_escFile) Size() int64 {
  96. return f.size
  97. }
  98. func (f *_escFile) Mode() os.FileMode {
  99. return 0
  100. }
  101. func (f *_escFile) ModTime() time.Time {
  102. return time.Unix(f.modtime, 0)
  103. }
  104. func (f *_escFile) IsDir() bool {
  105. return f.isDir
  106. }
  107. func (f *_escFile) Sys() interface{} {
  108. return f
  109. }
  110. // FS returns a http.Filesystem for the embedded assets. If useLocal is true,
  111. // the filesystem's contents are instead used.
  112. func FS(useLocal bool) http.FileSystem {
  113. if useLocal {
  114. return _escLocal
  115. }
  116. return _escStatic
  117. }
  118. // Dir returns a http.Filesystem for the embedded assets on a given prefix dir.
  119. // If useLocal is true, the filesystem's contents are instead used.
  120. func Dir(useLocal bool, name string) http.FileSystem {
  121. if useLocal {
  122. return _escDirectory{fs: _escLocal, name: name}
  123. }
  124. return _escDirectory{fs: _escStatic, name: name}
  125. }
  126. // FSByte returns the named file from the embedded assets. If useLocal is
  127. // true, the filesystem's contents are instead used.
  128. func FSByte(useLocal bool, name string) ([]byte, error) {
  129. if useLocal {
  130. f, err := _escLocal.Open(name)
  131. if err != nil {
  132. return nil, err
  133. }
  134. b, err := ioutil.ReadAll(f)
  135. _ = f.Close()
  136. return b, err
  137. }
  138. f, err := _escStatic.prepare(name)
  139. if err != nil {
  140. return nil, err
  141. }
  142. return f.data, nil
  143. }
  144. // FSMustByte is the same as FSByte, but panics if name is not present.
  145. func FSMustByte(useLocal bool, name string) []byte {
  146. b, err := FSByte(useLocal, name)
  147. if err != nil {
  148. panic(err)
  149. }
  150. return b
  151. }
  152. // FSString is the string version of FSByte.
  153. func FSString(useLocal bool, name string) (string, error) {
  154. b, err := FSByte(useLocal, name)
  155. return string(b), err
  156. }
  157. // FSMustString is the string version of FSMustByte.
  158. func FSMustString(useLocal bool, name string) string {
  159. return string(FSMustByte(useLocal, name))
  160. }
  161. var _escData = map[string]*_escFile{
  162. "/public/opencensus.css": {
  163. local: "public/opencensus.css",
  164. size: 0,
  165. modtime: 1519153040,
  166. compressed: `
  167. H4sIAAAAAAAC/wEAAP//AAAAAAAAAAA=
  168. `,
  169. },
  170. "/templates/footer.html": {
  171. local: "templates/footer.html",
  172. size: 16,
  173. modtime: 1519153248,
  174. compressed: `
  175. H4sIAAAAAAAC/7LRT8pPqbTjstHPKMnNseMCBAAA//8ATCBFEAAAAA==
  176. `,
  177. },
  178. "/templates/header.html": {
  179. local: "templates/header.html",
  180. size: 523,
  181. modtime: 1519164535,
  182. compressed: `
  183. H4sIAAAAAAAC/5TRv07rMBQG8D1P4ev1qvat7oKQEwZgYEAwdGF0nZP4UP+JfE6oqqrvjkyKBGIpky0f
  184. +6fP+syfu6fbzcvzvfAcQ9eYuohg09hKSLIzHmzfNUIIYSKwFc7bQsCtnHlYXcnziJEDdMej2tTN6WT0
  185. crJMA6adKBBaST4XdjMLdDlJ4QsMrdR6v9+rPEFykGgmhVkP9q1eUeiy1D8ZPgQgD8CfxjRvAzr9BXFE
  186. F730zBNdaz3kxKTGnMcAdkJSLkddM9wMNmI4tI+WoaANfx9cTiR/QbvcgxqBYx/q39bqv/qn45lTmHoc
  187. 82rCtFMR00fwM06u4MSihwGKoOIuJSvzSrIzehG6xuilSLPN/aHWvP7Wll93zXsAAAD//6iqQ1ULAgAA
  188. `,
  189. },
  190. "/templates/rpcz.html": {
  191. local: "templates/rpcz.html",
  192. size: 2626,
  193. modtime: 1519164559,
  194. compressed: `
  195. H4sIAAAAAAAC/+yW3WrbMBTH7/0UwmUjYyxJU3o1W1C6sQ4WNrq+gCwdfzBFMtJx9+Hl3cex3DhNCrOz
  196. XfbGxFZ+5/8D+Ry5bZ0wBbD5VxT4wdmm9tttlNQ8QZFpYFkhrbYuPQMAyHP2vVJYpufL5QueoGNCV4VJ
  197. JRgExxNUPMmtQearX5C+XvG2nb+rHEisrNlukwUt8mRB/1ugowuF8GRR8+ggMD7L8/wSIGa5ExtIM/uD
  198. SdDa10JWpkiX3V0tlKK7FY8ixhgjp6ECAFwqiHm3FJZLCi2DKnnsLzGphfdprM9jJi0lmfSCX9vG4FTo
  199. 6r5gWiAY+ZPNNv7VVP5WILCZq+ViOvvR1A2y2bfsBPZzg6fD752zzndU2Aza47H70r9KGnLka8DSql38
  200. S5P5+u3x9Vgr1HBVUSJfV2bel3i8cOOefn5ncf6c+Zz5XzKfaADyGLrlYn9UvlnxB52DERlFw4Q2oval
  201. RRrQDyX3zBVPMhq4oXlo2mZHjXvcyqrXjzv/mAp0A29dmQbht6TfVGscdWMbN5W5syj0I2ik59V98SmM
  202. 2F5240elDlynO5kKwjtspO3tl2sa6r2qEwijYnusM50KBdE9aqRqd4DsySqBYnT2Du6UT0OD+AE7Uj6c
  203. YKfaD/R0/YH9F/9wiE5uv4BN7L8A/a0BwxxqWzCKPg37b7bdgz8BAAD//6NjPmJCCgAA
  204. `,
  205. },
  206. "/templates/summary.html": {
  207. local: "templates/summary.html",
  208. size: 1619,
  209. modtime: 1519164559,
  210. compressed: `
  211. H4sIAAAAAAAC/6yVPW/bMBCG9/yKg2p4qu2kW12JRQtkCzok3YoOlHSWBdMngaSc2iz/e8EP+Stqi8Re
  212. DIo63t3zvjwr1TwXCEpvBWZJ3sgS5US1vKipmsNtwm4AAFItwyI8lFA0QrWcsjvgoq4oE7jQLM3ZU8sJ
  213. vvE1prOcpTNdnhxjY8pV+yn8/j5+8KFDiZMCSaNMXPLHjqim6i2pB5v/OFDjgWukYgtPfN0KVFerNcRz
  214. L2Ujhyuls17xv0t/pcbelsYYyalCmEbBvnbFCrVzXlmb6uU/wX8YM7X2Z0ReMmOQSmuviRIENGbEYZ7B
  215. 9LvkBap7KtumJm2teyNqWin/9sGt/GaAGsnmuaYSf733Sx/z2DyHkAmMiK/RbzreuFkvADdIh7NOBrkf
  216. LF6sKtl0VM7hHSImjlko9EGBHyZRAUdvTMzdD8b/9IgtRKijVC/k57CUuMgSp421n3dOOgeUGePBrB3v
  217. 9LbF7NY1Of1S6HrjG+HsUMr1ft7wIXIfdUb1aoa9Ib0bGy66IH28d07ACxjvxjvV5X5pzCj65rhDpSPs
  218. /o6e0J9Pge+G+dv98tClYlxs6IcDbPDW/wGpE8cGfB2Iiij9kHnIdOY/JezmTwAAAP//Dz6TJ1MGAAA=
  219. `,
  220. },
  221. "/templates/traces.html": {
  222. local: "templates/traces.html",
  223. size: 420,
  224. modtime: 1519164578,
  225. compressed: `
  226. H4sIAAAAAAAC/4yQsU70MBCEez/FKtIv3RW/w6WgOIw7kGgoDiRqO14gwnGM1xEgs++OnKMA5Qq2ssYz
  227. I82nolZW30UT4NaMuIdSZH0wg2qtVm3UQkVd1XlkhgO+zkiZvj8SavHwjAFO35U3kdDBhrDfiv9/PFFK
  228. MuEJQR6mN2IuJaYh5Edo/nXn1MBmCA7fQV4P6B3B2ZYZfnh23dqzO3p+i12tlp85mR4HxyxKweCYVbvs
  229. UjYt25UFyh8eL5t+8lPaWz/jRaPva+zGVUowogkEZMbo0UE6MpKiIlinTf9yMh6mvKpYMH8FAAD//yQs
  230. JUakAQAA
  231. `,
  232. },
  233. "/": {
  234. isDir: true,
  235. local: "",
  236. },
  237. "/public": {
  238. isDir: true,
  239. local: "public",
  240. },
  241. "/templates": {
  242. isDir: true,
  243. local: "templates",
  244. },
  245. }