bindata.go 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309
  1. // Code generated by go-bindata.
  2. // sources:
  3. // pub/close.svg
  4. // pub/index.css
  5. // pub/index.html
  6. // pub/index.js
  7. // DO NOT EDIT!
  8. package web
  9. import (
  10. "bytes"
  11. "compress/gzip"
  12. "fmt"
  13. "io"
  14. "strings"
  15. "os"
  16. "time"
  17. "io/ioutil"
  18. "path"
  19. "path/filepath"
  20. )
  21. func bindataRead(data, name string) ([]byte, error) {
  22. gz, err := gzip.NewReader(strings.NewReader(data))
  23. if err != nil {
  24. return nil, fmt.Errorf("Read %q: %v", name, err)
  25. }
  26. var buf bytes.Buffer
  27. _, err = io.Copy(&buf, gz)
  28. clErr := gz.Close()
  29. if err != nil {
  30. return nil, fmt.Errorf("Read %q: %v", name, err)
  31. }
  32. if clErr != nil {
  33. return nil, err
  34. }
  35. return buf.Bytes(), nil
  36. }
  37. type asset struct {
  38. bytes []byte
  39. info os.FileInfo
  40. }
  41. type bindataFileInfo struct {
  42. name string
  43. size int64
  44. mode os.FileMode
  45. modTime time.Time
  46. }
  47. func (fi bindataFileInfo) Name() string {
  48. return fi.name
  49. }
  50. func (fi bindataFileInfo) Size() int64 {
  51. return fi.size
  52. }
  53. func (fi bindataFileInfo) Mode() os.FileMode {
  54. return fi.mode
  55. }
  56. func (fi bindataFileInfo) ModTime() time.Time {
  57. return fi.modTime
  58. }
  59. func (fi bindataFileInfo) IsDir() bool {
  60. return false
  61. }
  62. func (fi bindataFileInfo) Sys() interface{} {
  63. return nil
  64. }
  65. var _closeSvg = "\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x2c\x8e\xd1\xca\x84\x20\x14\x84\x5f\xe5\x70\xee\xff\xa3\x1e\xc9\xfc\x97\xec\x62\xaf\xdb\x87\x58\x28\x32\x68\xb7\xd8\x24\x63\x9f\x7e\xd5\x02\x19\xc6\x6f\x66\xc4\x66\xdb\x47\x38\x5e\xf3\x7b\x73\xe8\x43\x58\x6f\x42\xc4\x18\x29\x6a\x5a\x3e\xa3\x60\x29\xa5\x48\x0d\x84\x38\xf5\xc1\x3b\xd4\x06\xc1\x0f\xd3\xe8\xc3\xe9\xf7\x69\x88\xf7\xe5\x70\x28\x41\x82\x36\xe9\x60\xdb\xac\xcf\xe0\xa1\x77\xf8\x60\x4b\x15\xfc\x93\xe1\x8e\x0d\x69\x0b\x75\xba\x2a\x0b\xaa\x22\x6b\x0b\x2f\xa4\xbe\x4a\x17\x57\x67\xaf\x2c\x66\x26\xc5\x90\xa5\x4b\x98\x65\x32\xb3\xcd\x2f\x15\xc9\xfc\xaf\x84\x25\x49\xcb\x2f\x8a\xb6\xc9\x1f\x6e\x7f\x01\x00\x00\xff\xff\xe5\x79\xbd\x91\xd8\x00\x00\x00"
  66. func closeSvgBytes() ([]byte, error) {
  67. return bindataRead(
  68. _closeSvg,
  69. "close.svg",
  70. )
  71. }
  72. func closeSvg() (*asset, error) {
  73. bytes, err := closeSvgBytes()
  74. if err != nil {
  75. return nil, err
  76. }
  77. info := bindataFileInfo{name: "close.svg", size: 216, mode: os.FileMode(420), modTime: time.Unix(1435948337, 0)}
  78. a := &asset{bytes: bytes, info: info}
  79. return a, nil
  80. }
  81. var _indexCss = "\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x94\x54\xdd\x6e\xdb\x3c\x0c\xbd\xcf\x53\x08\xed\x45\x1b\xa0\x4e\xd5\xe4\x4b\xf0\x45\x05\xf6\x10\xbb\xdb\x25\x2d\xd1\x8e\x50\xd9\x34\x24\x39\x3f\x1d\xf6\xee\xd3\x8f\x7f\xb2\xac\x05\x3a\x20\x09\x6c\xf2\x90\x3a\x3c\x3c\x4a\x49\xea\xc2\x7e\x2e\x18\x2b\x41\xbe\xd5\x96\xfa\x56\x09\x76\x5f\x55\xd5\x6b\x88\x55\xd4\xfa\xa2\x82\x46\x9b\x8b\x60\x0f\xdf\xc1\xe0\x09\x2e\x0f\x4f\xcc\x41\xeb\x0a\x87\x56\xcf\x28\xa7\xdf\x51\xb0\xff\xd6\xdd\x79\x0a\x9d\x50\xd7\x07\x2f\xd8\x86\xf3\xd7\xc5\xaf\xc5\xa2\x22\xdb\xa4\xa3\x3c\x9e\x7d\x01\x46\xd7\xad\x60\x12\x5b\x8f\x36\xe5\xef\x4b\xb0\x29\x7f\xd2\xca\x1f\x04\xdb\x6d\x87\x6e\x0d\xd8\x5a\x07\x2c\x67\xd0\x7b\x8a\x91\x8e\x9c\xf6\x9a\x42\xcc\xa2\x01\xaf\x8f\x98\x3b\xf4\xd6\xa4\x0e\xff\x4c\x7c\xf3\x29\xf1\x99\x0e\xe7\x19\xd3\x81\x52\xba\xad\x05\x5b\x6f\x73\x40\x92\x21\x1b\x54\xdb\xef\xf7\xf1\xb5\x24\xab\xd0\x16\x16\x94\xee\x5d\xd0\x24\x83\x72\x54\xb0\x97\xee\xcc\x1c\x19\xad\xd8\xbd\x94\x32\x66\xa8\xf7\x46\xb7\x81\x44\x4b\x2d\x66\xe8\xb9\x70\x07\x50\x74\x8a\x33\x07\x66\x6c\x17\xbe\xb6\x2e\xe1\x91\x3f\xb1\xe1\xb3\x5a\x2f\xa7\x99\x45\x45\xb2\x77\x79\x8d\x7f\x1f\xc3\xf7\xd5\x8c\x14\x61\xba\xf2\x4d\xfb\x42\xb7\x5d\xef\x8b\xce\x80\xc4\x03\x99\x50\x93\xca\xa7\x59\x94\x52\xd7\x45\x0d\xbd\x7f\x01\x2b\x9b\xee\xc6\x4b\xc5\x88\x41\xc4\x0f\xb5\x1b\xc4\xdd\xee\xf8\x67\xbb\xbe\x76\x8b\xc1\xca\xdf\x6c\x6e\xfd\x92\x0b\xbd\x0d\xbb\x1d\x4c\x91\x9e\x93\xdd\xd6\x9c\x37\x8e\x21\x38\x0c\x03\x17\x41\xe9\x09\x1a\xd3\x82\x39\x19\xbc\xf1\xe3\x91\x2f\xff\x88\x17\x64\x75\x62\xe1\xa9\x9b\x1c\x3a\x2d\xb6\x24\xef\xa9\x29\x22\x97\x8f\x97\x3c\x22\x6c\xb4\xd1\x57\x7d\x30\xea\xf7\x8d\x41\xd2\x70\x14\x2e\x6d\x6f\x50\x41\xa1\x24\x0b\x79\xc6\x6c\x96\x54\x65\xf2\xea\xe7\x4b\x01\x65\xe8\xdc\xfb\xa4\x78\x18\x21\xa8\x19\x9f\x6c\x76\x35\xcf\x2c\x22\xc3\xe1\x65\x34\xf8\xc8\x70\xde\x9e\x6e\xa0\x0e\x1a\x07\x0f\x3c\xde\x3d\xbb\x67\x69\xc8\xe1\xca\x1d\xeb\xbb\xe5\x0d\x70\x3e\x3b\xcb\x75\xad\xda\x8c\xb2\xd8\x21\xf8\xc8\x7d\x78\xbc\xc9\x0f\x7f\x22\xff\x07\x69\xe2\x4f\xba\x5b\xbd\x75\x51\x87\x8e\xf4\xd8\x90\x3a\x90\xda\x87\x8b\xcd\x57\x9b\x49\x01\x71\xa0\xe3\xe0\xcb\xab\xfc\x2e\xe6\x7f\x07\x00\x00\xff\xff\xcf\xf1\x6a\x9a\xe3\x04\x00\x00"
  82. func indexCssBytes() ([]byte, error) {
  83. return bindataRead(
  84. _indexCss,
  85. "index.css",
  86. )
  87. }
  88. func indexCss() (*asset, error) {
  89. bytes, err := indexCssBytes()
  90. if err != nil {
  91. return nil, err
  92. }
  93. info := bindataFileInfo{name: "index.css", size: 1251, mode: os.FileMode(420), modTime: time.Unix(1435949343, 0)}
  94. a := &asset{bytes: bytes, info: info}
  95. return a, nil
  96. }
  97. var _indexHtml = "\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x9c\x52\x4d\x73\xd3\x30\x10\xbd\xf7\x57\x2c\x3a\x13\x6d\x42\x38\x90\x62\x87\x19\x92\x0c\x30\x53\xa0\x53\xc2\x00\x47\xc5\x5e\xc7\x0a\xb2\xe5\x4a\xeb\x26\xfe\xf7\x48\xb6\xdb\x86\xd2\x13\x3a\xed\xd7\x7b\x6f\x3f\x94\xbc\x58\x7f\x5d\x6d\x7f\x5d\x6f\xa0\xe4\xca\xc0\xf5\xf7\xf7\x57\x9f\x56\x20\x26\x88\x3f\xe6\x2b\xc4\xf5\x76\x0d\x3f\x3f\x6e\x3f\x5f\xc1\x4c\x4e\xe1\x1b\x3b\x9d\x31\xe2\xe6\x8b\x00\x51\x32\x37\x97\x88\xc7\xe3\x51\x1e\xe7\xd2\xba\x3d\x6e\x6f\xf0\x14\x59\x66\x11\x36\x9a\x13\xdf\x63\x64\xce\xb9\x58\x5e\x24\xbd\xc8\xa9\x32\xb5\x4f\x9f\x21\x98\x2d\x16\x8b\x01\x17\x6a\x01\x92\x92\x54\x1e\x8d\x60\xb2\x66\x43\xcb\x0f\x36\xc1\xc1\x1a\xa2\x15\xb1\x82\xc8\x33\xa1\xdb\x56\xdf\xa5\x62\x65\x6b\xa6\x9a\x27\xdb\xae\x21\x01\xd9\xe0\xa5\x82\xe9\xc4\x18\x79\xdf\x42\x56\x2a\xe7\x89\xd3\x96\x8b\xc9\x1b\x81\x23\x91\xd1\xf5\x6f\x28\x1d\x15\xa9\x40\x8f\xba\xce\xe9\x24\x33\xef\x45\x9f\x8d\xcf\x91\x49\x85\xe7\xce\x90\x2f\x89\xf8\x31\xc1\x41\x69\x14\x88\x80\x7f\xf9\xc6\x31\x8b\xd0\x8b\x97\x7b\x6b\xf7\x86\x54\xa3\xbd\xcc\x6c\x15\x11\xef\x0a\x55\x69\xd3\xa5\x37\xca\xd0\x51\x75\x97\xaf\xa7\xd3\x97\xf3\xe9\xf4\xff\x94\x13\xbc\x5f\x59\xb2\xb3\x79\x37\x36\x53\x58\x57\x81\x6a\xd9\x06\xc9\xc6\x10\x07\x94\x2d\x8a\xb1\xd5\x90\xcf\xf5\x1d\xe8\x3c\x15\x3b\xe5\x1e\x82\x67\xe1\xcc\x04\xf2\x04\x83\x7b\x96\xd4\x75\xd3\xf2\x59\x0b\xa2\x2f\x6d\x9d\x11\xd0\x18\x95\x51\x69\x4d\x4e\x2e\x15\x9b\x70\x01\x07\x5c\x12\x84\x1c\xb0\x05\x5f\x5a\x17\x8e\x12\x19\x7b\x8e\x87\x2e\xce\x05\x1e\xb5\xab\xe6\x2f\xed\x04\xe3\x30\xcb\x8b\xc1\xf1\x99\xd3\x0d\x83\x77\x59\x38\x1b\xaa\x83\x3a\x3d\x5d\x70\x8c\xa1\xd1\x3b\x8f\x87\xdb\x96\x5c\x87\xaf\xe4\x4c\xce\x47\x47\x56\xba\x96\x87\x7e\xb8\x81\x69\xf9\x0c\xed\xfd\x6f\x78\x5a\x97\xe0\xb0\xe1\xa4\xff\x57\xcb\x8b\x3f\x01\x00\x00\xff\xff\xfc\x61\x6a\x79\x49\x03\x00\x00"
  98. func indexHtmlBytes() ([]byte, error) {
  99. return bindataRead(
  100. _indexHtml,
  101. "index.html",
  102. )
  103. }
  104. func indexHtml() (*asset, error) {
  105. bytes, err := indexHtmlBytes()
  106. if err != nil {
  107. return nil, err
  108. }
  109. info := bindataFileInfo{name: "index.html", size: 841, mode: os.FileMode(420), modTime: time.Unix(1435948513, 0)}
  110. a := &asset{bytes: bytes, info: info}
  111. return a, nil
  112. }
  113. var _indexJs = "\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x8c\x55\x5f\x6f\xd3\x3e\x14\x7d\xef\xa7\xf0\x4f\xbf\x49\xb6\x45\xe6\x6c\xf0\xb6\x8a\x07\x60\x45\x08\x4d\x14\xd1\xbe\x20\xc4\x83\x49\xdc\xc6\xab\x63\x47\xb6\xb3\xb6\x6c\xf9\xee\x5c\xdb\x49\xd3\xa2\x6a\xec\xa5\xb1\xef\x9f\x73\x6f\xee\x3d\x27\x25\xab\x56\x17\x5e\x1a\x4d\x28\x7a\x9c\x4c\x1e\xb8\x45\x56\x38\xf9\x5b\xa0\xb7\xe8\xc4\x85\x50\xf2\x15\x3e\x78\x8c\xad\xd9\x5a\x78\x72\x45\xc3\xe3\xbd\x69\x75\x29\xf5\xfa\x83\x92\x42\xfb\x6f\x10\x43\xe8\x14\x32\x62\x58\xe1\x1c\xc1\x35\xb7\x6b\xa9\x2f\xbd\x69\x70\x86\xb6\x52\x97\x66\xcb\xa4\xd6\xc2\x7e\x12\x72\x5d\xf9\xfc\x0d\xba\x8c\xd8\xac\x4a\xf7\xd7\x90\xdf\x4d\x53\x3f\x9a\xd7\xe2\xa3\x35\xf5\x71\x47\xad\x95\x63\x53\x0d\xb7\xde\x81\x17\x8c\xcc\xb5\xbf\x9c\xb7\xd0\x0b\xb9\xa6\xcc\x35\x4a\x7a\x82\x73\x1c\xbb\xb1\xc2\xb7\x56\xa7\xe8\x1f\xd7\x3f\xc7\x02\xca\xf0\xf2\xfc\xeb\x86\xd2\xe0\x19\x3a\x20\xca\x14\x3c\x84\xb0\x86\xfb\x2a\x58\x23\xf0\x05\xe3\xf7\x7c\x47\x42\x12\x82\x26\xd4\x0d\xc2\x39\x6f\x64\x0e\xc7\x1c\xa3\x57\x31\x3d\x8b\xce\x92\x7b\xbe\xdc\x37\x02\x22\xee\x9d\xd1\x18\x8c\x1d\x65\x5c\x6d\xf9\xde\x8d\x9b\x08\x51\xa9\x07\x84\xe4\x0a\x91\xff\x82\x81\x99\xcd\x60\x43\x28\xcf\xd1\x72\x7e\x3b\x27\x1b\x6d\xac\x37\x9a\xde\xa0\x99\xb5\xc6\xf6\xde\xf4\xa2\xd3\x78\xeb\x26\xf1\x11\x77\x67\x5a\x1f\xde\x26\xa2\xc5\x4b\xd6\x27\xc4\xae\xc1\x13\x8d\x2c\x9c\x9f\x9e\x10\xc6\x09\xe1\x82\xe0\xff\xc1\x84\x29\x7b\xe0\x0a\x06\xaf\x28\x5b\x99\xa2\x75\x69\xc5\x5d\x58\x54\x1a\xa3\xab\xcc\xf6\x4e\xea\xcd\xf1\x28\xe3\x8c\x0e\xe3\x2c\xea\x06\x9c\x01\x10\x4e\x98\x0e\xe5\x55\xcc\x39\xcc\xd6\x58\x09\x5c\x81\xb9\xe1\xc3\xf4\xa6\x93\x1e\x81\xc7\xfc\x12\xea\xd7\xc0\x34\x56\x58\xc1\xbd\x98\x29\x11\x6e\x04\x73\x4c\x69\xc4\x64\xdc\x7b\x4b\x70\x65\xc5\x0a\xf8\x06\xf8\xbd\xd9\x8b\x9d\x27\xe3\x95\x37\x8d\xd0\xe5\xd2\x10\x68\x27\xf9\x30\x20\xc4\x62\xc1\x12\x99\xeb\x2d\xd7\x2e\x10\x19\x80\xb0\x2b\xb8\x12\xdf\x81\x5a\x38\x45\x01\xf7\x17\x42\x89\x9e\x36\xcc\x81\x14\xb8\x13\xef\x74\x39\xdb\xf9\xd0\x11\xef\x45\x92\xa1\xab\x0c\x8d\x97\xeb\x23\x76\x07\xe8\x34\x94\x58\x84\x32\x40\xc2\xc0\xe2\x5a\x7a\xa8\x78\x18\x64\x3f\x45\xc1\x1a\x2b\x1e\x00\xfa\x56\xac\x78\xab\x7a\x9d\xbd\x8c\xaa\xc3\xb8\xd3\xae\x4f\xd7\x4a\x19\x88\xa6\x26\xe9\xad\x4e\xf8\xec\x13\x5d\xbf\xce\x17\x4b\x9c\x0d\x0c\x47\xcf\x53\x1c\xdc\x9f\x17\xf3\x2f\x2c\x29\x51\xae\xf6\xe4\xb1\xcf\x0a\xbf\x1d\x3d\x15\x03\xfa\xb7\x1a\x32\xe4\x77\x3e\x43\xbb\xca\x3e\xaf\x8b\x17\x33\x7f\x3a\x82\xc4\xfb\x89\xb4\x4a\x58\xa9\x17\xe5\xdf\x28\x67\x35\x32\x4a\xa8\x5f\x40\xf2\xc7\xcb\x91\x88\x42\xa5\x20\x9d\x43\x99\x4a\x3a\x6f\xec\x9e\x59\xd1\x28\x5e\x88\x85\x07\x1e\x93\xc7\x2e\x43\xba\x55\x0a\x98\x96\x8b\x52\xfa\xc3\x68\xe9\xb4\x4f\x1b\x34\x46\x8e\xac\xdd\x20\xc3\xb0\xbd\x28\x2e\xe5\x7a\x1e\x15\x4a\x16\x9b\x33\x34\x3a\x5d\x3e\x4e\xdf\xc7\x91\x82\x89\x7e\x64\xc0\xec\xbf\xd7\xbc\x2c\x67\x81\x7a\x77\xd0\xba\x80\x4f\x37\xc1\xe9\x9f\x02\xf0\xd3\x01\x62\xd3\x21\x64\x86\x8f\x6a\xe4\x53\x47\xc3\xe3\x4f\x00\x00\x00\xff\xff\xc9\x6d\x15\x96\x68\x06\x00\x00"
  114. func indexJsBytes() ([]byte, error) {
  115. return bindataRead(
  116. _indexJs,
  117. "index.js",
  118. )
  119. }
  120. func indexJs() (*asset, error) {
  121. bytes, err := indexJsBytes()
  122. if err != nil {
  123. return nil, err
  124. }
  125. info := bindataFileInfo{name: "index.js", size: 1640, mode: os.FileMode(420), modTime: time.Unix(1435966518, 0)}
  126. a := &asset{bytes: bytes, info: info}
  127. return a, nil
  128. }
  129. // Asset loads and returns the asset for the given name.
  130. // It returns an error if the asset could not be found or
  131. // could not be loaded.
  132. func Asset(name string) ([]byte, error) {
  133. cannonicalName := strings.Replace(name, "\\", "/", -1)
  134. if f, ok := _bindata[cannonicalName]; ok {
  135. a, err := f()
  136. if err != nil {
  137. return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err)
  138. }
  139. return a.bytes, nil
  140. }
  141. return nil, fmt.Errorf("Asset %s not found", name)
  142. }
  143. // MustAsset is like Asset but panics when Asset would return an error.
  144. // It simplifies safe initialization of global variables.
  145. func MustAsset(name string) []byte {
  146. a, err := Asset(name)
  147. if (err != nil) {
  148. panic("asset: Asset(" + name + "): " + err.Error())
  149. }
  150. return a
  151. }
  152. // AssetInfo loads and returns the asset info for the given name.
  153. // It returns an error if the asset could not be found or
  154. // could not be loaded.
  155. func AssetInfo(name string) (os.FileInfo, error) {
  156. cannonicalName := strings.Replace(name, "\\", "/", -1)
  157. if f, ok := _bindata[cannonicalName]; ok {
  158. a, err := f()
  159. if err != nil {
  160. return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err)
  161. }
  162. return a.info, nil
  163. }
  164. return nil, fmt.Errorf("AssetInfo %s not found", name)
  165. }
  166. // AssetNames returns the names of the assets.
  167. func AssetNames() []string {
  168. names := make([]string, 0, len(_bindata))
  169. for name := range _bindata {
  170. names = append(names, name)
  171. }
  172. return names
  173. }
  174. // _bindata is a table, holding each asset generator, mapped to its name.
  175. var _bindata = map[string]func() (*asset, error){
  176. "close.svg": closeSvg,
  177. "index.css": indexCss,
  178. "index.html": indexHtml,
  179. "index.js": indexJs,
  180. }
  181. // AssetDir returns the file names below a certain
  182. // directory embedded in the file by go-bindata.
  183. // For example if you run go-bindata on data/... and data contains the
  184. // following hierarchy:
  185. // data/
  186. // foo.txt
  187. // img/
  188. // a.png
  189. // b.png
  190. // then AssetDir("data") would return []string{"foo.txt", "img"}
  191. // AssetDir("data/img") would return []string{"a.png", "b.png"}
  192. // AssetDir("foo.txt") and AssetDir("notexist") would return an error
  193. // AssetDir("") will return []string{"data"}.
  194. func AssetDir(name string) ([]string, error) {
  195. node := _bintree
  196. if len(name) != 0 {
  197. cannonicalName := strings.Replace(name, "\\", "/", -1)
  198. pathList := strings.Split(cannonicalName, "/")
  199. for _, p := range pathList {
  200. node = node.Children[p]
  201. if node == nil {
  202. return nil, fmt.Errorf("Asset %s not found", name)
  203. }
  204. }
  205. }
  206. if node.Func != nil {
  207. return nil, fmt.Errorf("Asset %s not found", name)
  208. }
  209. rv := make([]string, 0, len(node.Children))
  210. for childName := range node.Children {
  211. rv = append(rv, childName)
  212. }
  213. return rv, nil
  214. }
  215. type bintree struct {
  216. Func func() (*asset, error)
  217. Children map[string]*bintree
  218. }
  219. var _bintree = &bintree{nil, map[string]*bintree{
  220. "close.svg": &bintree{closeSvg, map[string]*bintree{
  221. }},
  222. "index.css": &bintree{indexCss, map[string]*bintree{
  223. }},
  224. "index.html": &bintree{indexHtml, map[string]*bintree{
  225. }},
  226. "index.js": &bintree{indexJs, map[string]*bintree{
  227. }},
  228. }}
  229. // RestoreAsset restores an asset under the given directory
  230. func RestoreAsset(dir, name string) error {
  231. data, err := Asset(name)
  232. if err != nil {
  233. return err
  234. }
  235. info, err := AssetInfo(name)
  236. if err != nil {
  237. return err
  238. }
  239. err = os.MkdirAll(_filePath(dir, path.Dir(name)), os.FileMode(0755))
  240. if err != nil {
  241. return err
  242. }
  243. err = ioutil.WriteFile(_filePath(dir, name), data, info.Mode())
  244. if err != nil {
  245. return err
  246. }
  247. err = os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime())
  248. if err != nil {
  249. return err
  250. }
  251. return nil
  252. }
  253. // RestoreAssets restores an asset under the given directory recursively
  254. func RestoreAssets(dir, name string) error {
  255. children, err := AssetDir(name)
  256. // File
  257. if err != nil {
  258. return RestoreAsset(dir, name)
  259. }
  260. // Dir
  261. for _, child := range children {
  262. err = RestoreAssets(dir, path.Join(name, child))
  263. if err != nil {
  264. return err
  265. }
  266. }
  267. return nil
  268. }
  269. func _filePath(dir, name string) string {
  270. cannonicalName := strings.Replace(name, "\\", "/", -1)
  271. return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...)
  272. }