bindata.go 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. // Code generated by go-bindata. DO NOT EDIT.
  2. // sources:
  3. // assets/index.html
  4. package main
  5. import (
  6. "bytes"
  7. "compress/gzip"
  8. "fmt"
  9. "io"
  10. "io/ioutil"
  11. "os"
  12. "path/filepath"
  13. "strings"
  14. "time"
  15. )
  16. func bindataRead(data []byte, name string) ([]byte, error) {
  17. gz, err := gzip.NewReader(bytes.NewBuffer(data))
  18. if err != nil {
  19. return nil, fmt.Errorf("Read %q: %v", name, err)
  20. }
  21. var buf bytes.Buffer
  22. _, err = io.Copy(&buf, gz)
  23. clErr := gz.Close()
  24. if err != nil {
  25. return nil, fmt.Errorf("Read %q: %v", name, err)
  26. }
  27. if clErr != nil {
  28. return nil, err
  29. }
  30. return buf.Bytes(), nil
  31. }
  32. type asset struct {
  33. bytes []byte
  34. info os.FileInfo
  35. }
  36. type bindataFileInfo struct {
  37. name string
  38. size int64
  39. mode os.FileMode
  40. modTime time.Time
  41. }
  42. func (fi bindataFileInfo) Name() string {
  43. return fi.name
  44. }
  45. func (fi bindataFileInfo) Size() int64 {
  46. return fi.size
  47. }
  48. func (fi bindataFileInfo) Mode() os.FileMode {
  49. return fi.mode
  50. }
  51. func (fi bindataFileInfo) ModTime() time.Time {
  52. return fi.modTime
  53. }
  54. func (fi bindataFileInfo) IsDir() bool {
  55. return false
  56. }
  57. func (fi bindataFileInfo) Sys() interface{} {
  58. return nil
  59. }
  60. var _assetsIndexHtml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x4c\x8f\x3d\x6e\xc3\x30\x0c\x85\x77\x9d\x82\xd5\x5c\x57\xed\xd6\x81\xf2\xd2\x9f\xb5\x1d\xdc\xa1\xa3\x22\x11\x31\x01\x59\x0e\x6c\xc2\x4e\xb6\x20\x27\xc9\x92\x63\xf8\x34\x49\xee\x11\xd8\x42\x80\x4c\xc4\xe3\x47\x10\xdf\xc3\xa7\xcf\x9f\x8f\xea\xff\xf7\x0b\x6a\x69\x62\xa9\x70\x1e\x10\x5d\x5a\x5b\x4d\x49\xcf\x0b\x72\xa1\x54\x00\x00\xd8\x90\x38\xf0\xb5\xeb\x7a\x12\xab\xff\xaa\xef\xe2\x5d\x3f\xa2\xe4\x1a\xb2\x7a\x60\x1a\x37\x6d\x27\x1a\x7c\x9b\x84\x92\x58\x3d\x72\x90\xda\x06\x1a\xd8\x53\xb1\x84\x67\xe0\xc4\xc2\x2e\x16\xbd\x77\x91\xec\xdb\xcb\xeb\xfd\x95\xb0\x44\x2a\x39\x05\xda\xa2\xc9\x41\xa1\xc9\x1a\xb8\x6a\xc3\x2e\xdf\x5d\xa6\xe3\xf5\x34\x9d\xf7\x87\xd9\x58\xa1\xc9\x04\xcd\xd2\xe3\x16\x00\x00\xff\xff\x6d\xa3\xa0\x01\xd7\x00\x00\x00")
  61. func assetsIndexHtmlBytes() ([]byte, error) {
  62. return bindataRead(
  63. _assetsIndexHtml,
  64. "assets/index.html",
  65. )
  66. }
  67. func assetsIndexHtml() (*asset, error) {
  68. bytes, err := assetsIndexHtmlBytes()
  69. if err != nil {
  70. return nil, err
  71. }
  72. info := bindataFileInfo{name: "assets/index.html", size: 215, mode: os.FileMode(420), modTime: time.Unix(1728264874, 0)}
  73. a := &asset{bytes: bytes, info: info}
  74. return a, nil
  75. }
  76. // Asset loads and returns the asset for the given name.
  77. // It returns an error if the asset could not be found or
  78. // could not be loaded.
  79. func Asset(name string) ([]byte, error) {
  80. cannonicalName := strings.Replace(name, "\\", "/", -1)
  81. if f, ok := _bindata[cannonicalName]; ok {
  82. a, err := f()
  83. if err != nil {
  84. return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err)
  85. }
  86. return a.bytes, nil
  87. }
  88. return nil, fmt.Errorf("Asset %s not found", name)
  89. }
  90. // MustAsset is like Asset but panics when Asset would return an error.
  91. // It simplifies safe initialization of global variables.
  92. func MustAsset(name string) []byte {
  93. a, err := Asset(name)
  94. if err != nil {
  95. panic("asset: Asset(" + name + "): " + err.Error())
  96. }
  97. return a
  98. }
  99. // AssetInfo loads and returns the asset info for the given name.
  100. // It returns an error if the asset could not be found or
  101. // could not be loaded.
  102. func AssetInfo(name string) (os.FileInfo, error) {
  103. cannonicalName := strings.Replace(name, "\\", "/", -1)
  104. if f, ok := _bindata[cannonicalName]; ok {
  105. a, err := f()
  106. if err != nil {
  107. return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err)
  108. }
  109. return a.info, nil
  110. }
  111. return nil, fmt.Errorf("AssetInfo %s not found", name)
  112. }
  113. // AssetNames returns the names of the assets.
  114. func AssetNames() []string {
  115. names := make([]string, 0, len(_bindata))
  116. for name := range _bindata {
  117. names = append(names, name)
  118. }
  119. return names
  120. }
  121. // _bindata is a table, holding each asset generator, mapped to its name.
  122. var _bindata = map[string]func() (*asset, error){
  123. "assets/index.html": assetsIndexHtml,
  124. }
  125. // AssetDir returns the file names below a certain
  126. // directory embedded in the file by go-bindata.
  127. // For example if you run go-bindata on data/... and data contains the
  128. // following hierarchy:
  129. // data/
  130. // foo.txt
  131. // img/
  132. // a.png
  133. // b.png
  134. // then AssetDir("data") would return []string{"foo.txt", "img"}
  135. // AssetDir("data/img") would return []string{"a.png", "b.png"}
  136. // AssetDir("foo.txt") and AssetDir("notexist") would return an error
  137. // AssetDir("") will return []string{"data"}.
  138. func AssetDir(name string) ([]string, error) {
  139. node := _bintree
  140. if len(name) != 0 {
  141. cannonicalName := strings.Replace(name, "\\", "/", -1)
  142. pathList := strings.Split(cannonicalName, "/")
  143. for _, p := range pathList {
  144. node = node.Children[p]
  145. if node == nil {
  146. return nil, fmt.Errorf("Asset %s not found", name)
  147. }
  148. }
  149. }
  150. if node.Func != nil {
  151. return nil, fmt.Errorf("Asset %s not found", name)
  152. }
  153. rv := make([]string, 0, len(node.Children))
  154. for childName := range node.Children {
  155. rv = append(rv, childName)
  156. }
  157. return rv, nil
  158. }
  159. type bintree struct {
  160. Func func() (*asset, error)
  161. Children map[string]*bintree
  162. }
  163. var _bintree = &bintree{nil, map[string]*bintree{
  164. "assets": &bintree{nil, map[string]*bintree{
  165. "index.html": &bintree{assetsIndexHtml, map[string]*bintree{}},
  166. }},
  167. }}
  168. // RestoreAsset restores an asset under the given directory
  169. func RestoreAsset(dir, name string) error {
  170. data, err := Asset(name)
  171. if err != nil {
  172. return err
  173. }
  174. info, err := AssetInfo(name)
  175. if err != nil {
  176. return err
  177. }
  178. err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755))
  179. if err != nil {
  180. return err
  181. }
  182. err = ioutil.WriteFile(_filePath(dir, name), data, info.Mode())
  183. if err != nil {
  184. return err
  185. }
  186. err = os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime())
  187. if err != nil {
  188. return err
  189. }
  190. return nil
  191. }
  192. // RestoreAssets restores an asset under the given directory recursively
  193. func RestoreAssets(dir, name string) error {
  194. children, err := AssetDir(name)
  195. // File
  196. if err != nil {
  197. return RestoreAsset(dir, name)
  198. }
  199. // Dir
  200. for _, child := range children {
  201. err = RestoreAssets(dir, filepath.Join(name, child))
  202. if err != nil {
  203. return err
  204. }
  205. }
  206. return nil
  207. }
  208. func _filePath(dir, name string) string {
  209. cannonicalName := strings.Replace(name, "\\", "/", -1)
  210. return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...)
  211. }