favicon.go 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. // Code generated by go-bindata.
  2. // sources:
  3. // favicon/favicon.ico
  4. package images
  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 _favicon = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xec\x94\x5f\x48\x53\x51\x1c\xc7\xbf\x77\xce\xeb\xf1\xff\x9d\x53\x37\xe7\xbf\x4d\xcd\x2c\x08\xa2\x87\xea\xd1\x82\x9e\xa2\x88\x5e\x7a\x8a\x82\x1e\xf2\x21\x7a\x28\x42\xc9\x7a\xb0\x08\x22\x4d\x08\xfa\x43\x25\x61\x05\x4b\xac\xb7\x7a\x92\x8a\x82\xa2\x34\x59\x5c\x4d\x5b\x39\x2d\xfb\xb3\x9c\xe0\x52\xb7\x5a\x6e\x73\xeb\xdc\xbb\xed\xb6\x5d\xc7\x89\x7a\xa8\xa0\xfb\x81\x7b\xef\x39\xbf\xef\x3d\xf7\xfe\xce\x79\xf8\x00\x1c\x74\x10\x04\xe9\x49\xd0\x94\x09\xd4\x03\xb0\x5a\x63\xf3\x1e\x02\x74\xd2\x5a\x03\xad\x09\x52\x1d\xb1\xba\x0c\x87\x1f\x70\xb1\xab\xff\xd0\x2a\x0c\x9d\xde\x0e\xf1\xe4\x66\xbc\xba\xb2\x0f\xe1\xc0\x3c\x5e\x77\xef\x87\xe7\xe9\x4d\xcc\x3a\x1f\x21\x1a\x8d\x22\x1a\x89\xc0\x7d\xbf\x0b\x03\xcd\xab\x31\xde\x73\x18\x6f\x6e\xb5\x61\xea\xf1\x0d\x84\xbf\xf9\x31\x76\xfd\x20\xbe\x4e\xb9\x20\xb6\x6f\xc5\xb3\xd6\xb5\x78\x7e\x62\x13\x7d\xae\x83\xa3\xad\x11\x73\xae\x7e\xbc\x38\xb3\x03\x23\x67\x77\x62\x61\xd6\x03\x67\x57\x13\x1c\xc7\x37\x62\xa2\xf7\x28\x22\xe1\x10\x7c\x93\x22\x42\x7e\x2f\x82\x73\xd3\x18\x68\x59\x03\x97\xbd\x05\x43\x1d\xdb\xa0\xa1\xa1\xf1\xaf\x51\x5b\x97\x3c\xab\x29\x20\xe6\xa4\x69\x71\x35\x21\x56\x1b\x25\x3e\xaf\xac\x22\x31\x12\x2f\x94\x59\x48\x79\x05\x45\x7e\xb9\x84\xde\x4a\x4d\xca\xfa\x0c\x43\x11\xbd\xe7\x1a\xa5\x71\x3e\xa5\x80\x14\x0a\x89\x2c\xfe\x19\x92\x17\x9f\xf3\x94\x2c\x92\x9d\x93\x9b\xf4\xf3\x0c\x7d\x66\x4a\xa7\x9c\xee\xb7\x37\xf9\xcb\x48\x9e\xb5\xd2\xab\x11\x49\x9e\xd5\x27\x37\x03\xc5\xb3\x8e\x63\x1b\xe0\x79\xd2\x8b\x4f\x0f\xaf\xca\x2e\x95\x1c\x2b\xf9\x75\x7e\x7c\x50\x76\xe0\xe8\xf9\x5d\xb2\x2f\xbd\xc3\x77\x11\x59\x0c\x61\xf2\x76\x3b\x66\xc4\x3e\x0c\x1e\x59\x8f\xc0\xf4\x84\xec\xd6\x0f\x7d\xe7\xe0\x7f\x3f\x22\x7b\x33\xf4\xe5\xb3\xec\x54\xc9\x9d\x8b\xc1\x00\x75\x73\x2b\x86\xa9\xcb\xdf\xdd\xe9\x94\x1d\xed\xb2\x37\x53\x4f\xdb\xe1\x7b\x2b\xe2\xe3\xbd\x4b\x78\x79\x71\x0f\x82\xbe\x19\x38\x2f\xef\xa5\xdf\xee\xc0\xe8\x85\xdd\x58\xf0\xba\xe1\x7e\xd0\x8d\xb1\x6b\x07\x64\x9f\x8b\xa7\xb6\xfc\xb9\xc3\xd3\xd0\xd0\xf8\x7b\xac\xb4\x31\xe3\x86\x15\x15\x8c\x54\xbf\x9c\xe7\x19\x39\x97\xc5\xb3\xf2\x65\x44\x32\x79\xbd\x31\x81\x2a\xae\xcb\xe3\x53\x49\x8d\x6b\x79\x35\xaa\xf5\xb6\x1a\x76\x0e\x43\xb5\x54\xb5\xe6\x24\x58\xd2\xa0\xa9\x8a\xd9\x3f\xa5\xd2\x9c\x2e\x2f\xb7\x28\x43\x8b\x90\x26\xcf\x34\x97\x29\xe3\x42\x4b\x9a\x9c\xe7\x75\x26\xc6\x5f\x69\xce\x1b\x0d\x4b\xca\xca\x41\x16\x4b\xfb\x2a\x29\x55\xe7\xea\xf3\x2a\xfa\x49\x2e\x18\x98\x79\x41\xa1\x6a\xbd\x72\x90\xb9\x34\xcd\xcb\x67\xf6\x4f\xb2\x99\xfb\xcb\xe2\x18\x31\x74\x19\x7a\x56\x0c\xe6\xe2\xff\x97\xef\x01\x00\x00\xff\xff\x3e\xd4\x17\xe7\x36\x0e\x00\x00")
  61. func faviconBytes() ([]byte, error) {
  62. return bindataRead(
  63. _favicon,
  64. "favicon/favicon.ico",
  65. )
  66. }
  67. func favicon() (*asset, error) {
  68. bytes, err := faviconBytes()
  69. if err != nil {
  70. return nil, err
  71. }
  72. info := bindataFileInfo{name: "favicon/favicon.ico", size: 3638, mode: os.FileMode(420), modTime: time.Unix(1460621502, 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. "favicon/favicon.ico": favicon,
  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. "favicon": &bintree{nil, map[string]*bintree{
  165. "favicon.ico": &bintree{favicon, 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. }