2017-07-09 00:12:47 +00:00
|
|
|
// Code generated by go-bindata.
|
|
|
|
// sources:
|
|
|
|
// static/highlight.js
|
|
|
|
// static/wiki.css
|
|
|
|
// DO NOT EDIT!
|
|
|
|
|
2017-07-12 06:43:11 +00:00
|
|
|
package yatwiki
|
2017-07-09 00:12:47 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"bytes"
|
|
|
|
"compress/gzip"
|
|
|
|
"fmt"
|
|
|
|
"io"
|
|
|
|
"io/ioutil"
|
|
|
|
"os"
|
|
|
|
"path/filepath"
|
|
|
|
"strings"
|
|
|
|
"time"
|
|
|
|
)
|
|
|
|
|
|
|
|
func bindataRead(data []byte, name string) ([]byte, error) {
|
|
|
|
gz, err := gzip.NewReader(bytes.NewBuffer(data))
|
|
|
|
if err != nil {
|
|
|
|
return nil, fmt.Errorf("Read %q: %v", name, err)
|
|
|
|
}
|
|
|
|
|
|
|
|
var buf bytes.Buffer
|
|
|
|
_, err = io.Copy(&buf, gz)
|
|
|
|
clErr := gz.Close()
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
return nil, fmt.Errorf("Read %q: %v", name, err)
|
|
|
|
}
|
|
|
|
if clErr != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
return buf.Bytes(), nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type asset struct {
|
|
|
|
bytes []byte
|
|
|
|
info os.FileInfo
|
|
|
|
}
|
|
|
|
|
|
|
|
type bindataFileInfo struct {
|
|
|
|
name string
|
|
|
|
size int64
|
|
|
|
mode os.FileMode
|
|
|
|
modTime time.Time
|
|
|
|
}
|
|
|
|
|
|
|
|
func (fi bindataFileInfo) Name() string {
|
|
|
|
return fi.name
|
|
|
|
}
|
|
|
|
func (fi bindataFileInfo) Size() int64 {
|
|
|
|
return fi.size
|
|
|
|
}
|
|
|
|
func (fi bindataFileInfo) Mode() os.FileMode {
|
|
|
|
return fi.mode
|
|
|
|
}
|
|
|
|
func (fi bindataFileInfo) ModTime() time.Time {
|
|
|
|
return fi.modTime
|
|
|
|
}
|
|
|
|
func (fi bindataFileInfo) IsDir() bool {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
func (fi bindataFileInfo) Sys() interface{} {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2017-10-29 01:05:20 +00:00
|
|
|
var _highlightJs = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xbc\xbc\x6d\x77\xdb\x38\x92\x30\xfa\x3d\xbf\x02\xe1\xa4\x63\xd2\xa2\x65\x67\xf6\xdc\x67\xcf\x48\xa6\xdd\xb2\xad\x74\xb4\xb1\xe5\xac\xed\x74\xb6\x57\x54\x34\x20\x09\x49\x6c\x53\x04\x05\x80\x96\x15\x51\xf3\xdb\xef\xa9\x02\xf8\x22\xbf\xa4\xe7\x7e\xb8\xcf\xe9\x8e\x45\x01\x05\xa0\x50\xa8\x77\x14\x75\xb8\xff\xf6\xcd\x39\xcf\xd6\x22\x9e\xcd\x15\xb1\x43\x87\xfc\xfd\xe8\xe8\xff\xb8\x64\xf0\x40\x53\x72\x4b\x67\x34\xa1\xec\xe1\x4d\x2f\x49\x08\x42\x48\x22\x98\x64\xe2\x81\x45\xed\x37\x37\x2c\x8a\xa5\x12\x71\x90\xab\x98\xa7\x84\xa6\x11\xc9\x25\x23\x71\x4a\x24\xcf\x45\xc8\xb0\x25\x88\x53\x2a\xd6\x64\xca\xc5\x42\xba\x64\x15\xab\x39\xe1\x02\x3f\x79\xae\xde\x2c\x78\x14\x4f\xe3\x90\xc2\x04\x2e\xa1\x82\x91\x8c\x89\x45\xac\x14\x8b\x48\x26\xf8\x43\x1c\xb1\x88\xa8\x39\x55\x44\xcd\x19\x99\xf2\x24\xe1\xab\x38\x9d\x91\x90\xa7\x51\x0c\x83\x24\x0e\x5a\x30\xd5\x79\xf3\x86\x10\x42\xf6\xc9\x2e\x56\x92\xf0\x69\x89\x4e\xc8\x23\x46\x16\xb9\x54\x44\x30\x45\xe3\x14\xe7\xa4\x01\x7f\x80\x2e\x43\x01\x9c\x84\x90\x94\xab\x38\x64\x2e\x51\xf3\x58\x92\x24\x96\x0a\xa6\x69\x2e\x9a\x46\x4f\x30\x8a\x62\x19\x26\x34\x5e\x30\xd1\x7e\x05\x91\x38\x6d\x12\xa3\x44\x24\x13\x3c\xca\x43\xf6\xff\x13\x2e\x44\xef\xd2\xcc\x14\xf1\x30\x5f\xb0\x54\xd1\xf2\xbc\x0e\xb9\x20\x5c\xcd\x99\x20\x0b\xaa\x98\x88\x69\x22\x6b\xb2\xe3\x59\xc1\xc4\xcd\x6d\x94\x9b\x1b\xb2\x18\xc7\x41\x7f\x4a\x17\x0c\x70\x9a\xc7\xb3\x79\x02\x88\xb7\xff\x94\x24\xe5\x75\x27\x1e\x42\xac\x24\x60\xad\x67\xe2\x42\x12\x83\xd4\x82\xae\x49\xc0\x80\x73\x22\xa2\x38\x61\x69\xc4\x85\x64\xc0\x24\x99\xe0\x0b\xae\x18\xd1\x24\x52\x92\x44\x4c\xc4\x0f\x2c\x22\x53\xc1\x17\x9a\x1c\x92\x4f\xd5\x0a\x38\xc0\x4c\x66\xf8\x8a\xc8\x8c\x85\xc0\x58\x24\x13\x31\xb0\x9b\x00\x96\x4a\x35\x73\x49\x89\xfb\x78\x73\xf7\x69\x70\x4b\x6e\xaf\x3f\xde\x7d\xeb\xdd\xf4\xc9\xe0\x96\x7c\xb9\xb9\xfe\x7d\x70\xd1\xbf\x20\x67\x7f\x90\xbb\x4f\x7d\x72\xd3\xff\xad\x3f\xbc\xbb\x25\xbd\xe1\x05\x39\xbf\x1e\xde\xdd\x0c\xce\xbe\xde\x5d\xdf\xdc\x92\x7f\xfe\xb3\x77\x4b\x06\xb7\x7b\x7b\xd8\xd5\x1b\xfe\xf1\xa6\xff\x3f\x5f\x6e\xfa\xb7\xb7\xe4\xfa\x86\x0c\xae\xbe\x5c\x0e\xfa\x17\xe4\x5b\xef\xe6\xa6\x37\xbc\x1b\xf4\x6f\x5d\x32\x18\x9e\x5f\x7e\xbd\x18\x0c\x7f\x73\xc9\xd9\xd7\x3b\x32\xbc\xbe\x23\x97\x83\xab\xc1\x5d\xff\x82\xdc\x5d\xbb\xb8\x98\x19\xf6\xa6\x1e\x46\xae\x3f\x92\xab\xfe\xcd\xf9\xa7\xde\xf0\xae\x77\x36\xb8\x1c\xdc\xfd\x81\xeb\x7d\x1c\xdc\x0d\x61\xad\x8f\xd7\x37\xa4\x47\xbe\xf4\x6e\xee\x06\xe7\x5f\x2f\x7b\x37\xe4\xcb\xd7\x9b\x2f\xd7\xb7\x7d\xd2\xbb\xe9\xbf\xb9\x18\xdc\x9e\x5f\xf6\x06\x57\xfd\x8b\x36\x19\x0c\xc9\xf0\x9a\xf4\x7f\xef\x0f\xef\xc8\xed\xa7\xde\xe5\xe5\xcf\x77\x77\xd6\x27\x97\x83\xde\xd9\x65\x5f\xaf\x30\xfc\xe3\xcd\xc5\xe0\xa6\x7f\x7e\x07\xdb\xa8\x9f\xce\x07\x17\xfd\xe1\x5d\xef\xd2\x25\xb7\x5f\xfa\xe7\x03\x78\xe8\xff\x4f\xff\xea\xcb\x65\xef\xe6\x0f\x17\xe8\x70\x7e\x3d\xbc\xed\xff\xf7\xd7\xfe\xf0\x6e\xd0\xbb\x24\x17\xbd\xab\xde\x6f\xfd\xdb\x37\xf6\x5f\x90\xe2\xcb\xcd\xf5\xf9\xd7\x9b\xfe\x15\xe0\x7a\xfd\x91\xdc\x7e\x3d\xbb\xbd\x1b\xdc\x7d\xbd\xeb\x93\xdf\xae\xaf\x2f\x90\xc0\xb7\xfd\x9b\xdf\x07\xe7\xfd\xdb\xee\x9b\xcb\xeb\x5b\xa4\xd2\xd7\xdb\xbe\x4b\x2e\x7a\x77\x3d\x5c\xf8\xcb\xcd\xf5\xc7\xc1\xdd\x6d\x17\x9e\xcf\xbe\xde\x0e\x90\x58\x83\xe1\x5d\xff\xe6\xe6\xeb\x97\xbb\xc1\xf5\xd0\x21\x9f\xae\xbf\xf5\x7f\xef\xdf\x90\xf3\xde\xd7\xdb\x3e\x9c\xe0\xc5\x9b\xeb\x21\x6c\x15\x28\x73\x7d\xf3\x07\x4c\x0a\x34\x40\xa2\xbb\xe4\xdb\xa7\xfe\xdd\xa7\xfe\x0d\x10\x12\x29\xd5\x03\x12\xdc\xde\xdd\x0c\xce\xef\x9a\x60\xd7\x37\xe4\xee\xfa\xe6\xae\xb1\x47\x32\xec\xff\x76\x39\xf8\xad\x3f\x3c\xef\x43\xef\x35\xcc\xf2\x6d\x70\xdb\x77\x48\xef\x66\x70\x0b\x00\x03\xbd\xec\xb7\xde\x1f\xe4\xfa\x2b\x6e\x19\xce\xe6\xeb\x6d\x5f\x3f\x0e\x6e\xdf\x94\x1c\xea\xe2\x09\x92\xc1\x47\xd2\xbb\xf8\x7d\x00\x68\x1b\xe0\x2f\xd7\xb7\xb7\x03\xc3\x1f\x48\xb2\xf3\x4f\x86\xdc\xed\x37\xfb\x87\x6f\x1e\xa8\x20\xf3\xe4\x4f\xe9\xa5\x6c\x45\xa6\x79\x1a\x82\x18\xdb\xce\xa6\x7c\x24\x89\xcd\x9d\x8d\x60\x2a\x17\x29\xe1\x6d\xc1\xb2\x84\x86\xcc\x3e\x7c\x7f\x38\x5b\xb8\xd6\x7b\xba\xc8\xba\x96\x53\x37\x1f\xeb\xe6\x44\xed\xb4\x9e\xe8\xd6\x19\xb4\x6e\xab\x99\x03\x3b\x73
|
2017-07-09 00:12:47 +00:00
|
|
|
|
|
|
|
func highlightJsBytes() ([]byte, error) {
|
|
|
|
return bindataRead(
|
|
|
|
_highlightJs,
|
|
|
|
"highlight.js",
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
func highlightJs() (*asset, error) {
|
|
|
|
bytes, err := highlightJsBytes()
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
|
|
|
info := bindataFileInfo{name: "highlight.js", size: 24356, mode: os.FileMode(420), modTime: time.Unix(1498271514, 0)}
|
|
|
|
a := &asset{bytes: bytes, info: info}
|
|
|
|
return a, nil
|
|
|
|
}
|
|
|
|
|
2018-04-02 05:39:51 +00:00
|
|
|
var _wikiCss = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xb4\x58\x6d\x6f\xe3\xb8\x11\xfe\x1c\x03\xfe\x0f\x04\x82\x02\x6d\x60\x2b\x92\x13\xef\x65\xe5\xa2\x68\x9b\x64\xd1\xf6\xeb\x2d\xee\xeb\x82\x12\xc7\x12\xd7\x14\xa9\x23\xa9\xd8\xde\x20\xff\xbd\xe0\x9b\x44\xc9\x4a\x7a\x2d\xae\x59\xac\x20\x8a\xa3\x99\x67\x9e\x79\xa3\x7c\x7b\x83\x8e\xf4\x40\x93\x52\x29\x74\x73\xbb\x5c\xd4\xba\x61\xab\x42\x90\x33\x7a\x5d\x2e\xae\x0a\x5c\x1e\x2a\x29\x3a\x4e\xf2\x63\x4d\x35\xec\x4a\xc1\x84\xcc\x0b\x86\xcb\xc3\x6e\x2f\xb8\x5e\x2b\xfa\x03\xf2\x6c\xd3\x9e\x76\xcb\xc5\x55\x83\x65\x45\x79\x9e\xee\x5a\x4c\x08\xe5\x55\x9e\xee\x0a\x21\x09\xc8\x3c\xdd\x2d\x17\x6f\x91\xf6\x15\xe5\x6d\xa7\x5f\xad\x8a\x3d\x6e\x28\x3b\xe7\xbf\x80\x24\x98\xe3\xd5\xdf\x24\xc5\x6c\xf7\xb6\x5c\x68\x5c\x30\x58\x69\xb9\xd2\x64\xa5\x6b\xf4\x1a\x54\xb5\x27\xb3\x6b\x15\x20\x84\x5e\x07\x18\x0f\x6e\x07\x23\xf7\xf7\xaa\xe1\xa4\xd7\x04\x4a\x21\xb1\xa6\x82\xe7\x5c\xf0\xe0\x01\x2a\x58\x07\x56\x38\xaf\xc5\x0b\xc8\x4b\xe1\x8e\x13\x90\x8c\x72\x2b\x45\x9b\xca\xa9\x8c\x30\x34\xf8\xb4\x3e\x52\xa2\xeb\x3c\x4b\xd3\x3f\x18\xa9\x8e\x79\xc3\x81\x87\xf6\xb4\x43\x9e\x8a\x35\x83\xbd\xce\xef\x3c\xf8\x7a\xe3\x25\x09\x55\x2d\xc3\xe7\x9c\xf2\x60\xaa\x95\xe0\xb6\x62\x6e\x1e\x05\x57\x82\x61\xb5\x7a\x14\x9d\xa4\x20\x57\x8d\xe0\x42\xb5\xb8\x84\x38\x0a\x99\x53\xae\x89\x57\xde\x47\xa1\x3d\xa1\xcc\x5b\x4e\x4a\xc1\x35\x70\xdd\x6f\x7a\xd2\x12\xf5\x0e\x69\x06\xd7\x5a\xd7\x52\x74\x55\xed\x04\x5b\x41\x19\xc8\xd7\x38\x15\x86\x3c\x59\xc7\x8f\x23\x71\x47\xb3\x7f\xc9\xe5\xd2\xdb\x72\xb1\x5c\xe0\x84\x00\x03\x0d\xc4\xe6\x9b\xdb\x96\x40\x4c\x36\x7d\x88\xc4\xa6\xd3\x72\x91\xd0\xa6\xea\xa4\xcb\x55\x17\x9a\xac\x3d\x21\x25\x18\x25\xc8\x59\x59\x2e\xae\x5c\x94\x3e\xa7\x2e\x49\x6b\xa0\x55\xad\xfb\xa5\x68\x71\x49\xf5\x39\x4f\x93\x4f\x66\xb9\x6e\xc4\x8f\xb5\x96\x98\x2b\x6a\x8d\x62\xc6\x50\x9a\x64\x0a\x19\xeb\x58\x5a\x91\x23\x14\x07\xaa\x3f\x96\x7a\x0b\xd8\x42\x7e\x05\x3b\x28\x4b\x52\xe7\xfa\xed\x0d\xfa\x07\x60\x02\xd2\x16\x5e\x52\xbb\xfb\x49\xd9\x5d\x3f\x3d\x3d\x19\xa3\x21\x5c\x77\x0e\xf5\x10\x75\xef\x46\x21\x4e\x6b\x55\x63\x22\x8e\x39\x32\xf1\xbe\x6f\x4f\x68\x63\x2e\xd7\x8f\x8f\x8f\x46\xe0\xf6\xa6\x15\x01\x6d\xa1\x04\xeb\x1c\x37\x36\x2d\xd3\x9d\xb4\x9c\xa4\x3b\x83\xe4\x6d\x00\x83\xdf\x83\xe3\x02\x55\x49\x38\xcf\x45\x0a\xd9\x4a\x8b\x1a\x82\x01\x13\x70\x4e\xa2\x14\x34\x8e\x2b\x61\x5d\x30\x51\x1e\xa2\x70\x65\x9f\xdc\xfb\x81\x87\x4d\x7b\x42\x9e\x8b\xdf\x33\x64\xc1\xef\x10\xb5\xb9\x1e\xd8\xbb\xef\x92\x7c\xce\xa9\xc9\xce\x7a\xa0\xcb\x6d\xf9\xab\xe7\xcf\xe6\x0a\xdf\x0b\x6b\x2e\xf0\xd0\x13\x70\xa1\x9c\x60\x79\x08\xcc\xc7\x74\xdc\x8f\x9a\xb0\x29\x78\xb4\x75\x8f\xa6\x70\xa7\xd5\xca\x0c\xc5\x67\x60\x4c\x1c\x43\x61\xdd\xde\xa0\x67\x42\xb5\x90\xa8\xc5\x15\xd8\x0c\xdd\x53\x60\x44\x81\xee\xbb\xe0\x00\xc9\xc2\x79\x8b\x44\x18\x54\xc0\x5d\x4d\xc7\x10\x3f\xb9\x44\x40\x3e\x98\x33\x89\x35\xaf\x3a\x64\xfc\xd1\x25\x43\x21\x18\xf1\xbc\x81\x03\x19\x1b\x4a\xc7\xc3\xc8\xad\x5e\x40\x6a\x5a\x62\xb6\xc6\x8c\x56\x3c\xd7\xa2\x75\x0a\xae\x7d\x3f\x2c\xf5\x45\x17\x21\x58\xd5\x40\x90\x25\xa7\xe7\x7b\xae\x86\xb4\x68\xf3\x6c\x63\x0c\xb9\x32\xb2\xbd\xb6\x10\x5a\x8b\xc6\xdd\xdb\x22\xcb\x1c\x92\x08\xb4\x29\x1b\x2c\xc1\x15\xd9\x7f\xdf\xee\xd3\xdf\x32\x74\xaf\xfa\xfe\x67\xa7\x54\xa8\x26\x73\x6f\xde\xa5\x3c\x9e\x61\x66\x19\x4b\xa0\xdb\x1b\xc4\x05\x92\x60\x0c\xda\x1c\xb8\x9a\x4c\x3d\xb3\x9c\xe8\xbc\xa4\xc8\xa8\xf9\xe7\xf3\x4f\x28\x34\x97\xbd\x6c\xe6\x3b\x76\x9f\x04\x51\x5e\x3c\x3f\x3f\x8f\x1b\x5e\xf0\x3b\xb8\xbb\x1d\xd1\xb0\xf5\xb3\xce\x5f\xb6\x81\x73\x9b\xd1\x5f\xcd\x89\x42\x21\xca\x91\x8f\xba\xeb\xbc\x9a\x46\xb3\xdd\x94\x04\xc3\xad\x82\x1c\x85\xbb\x1d\xf2\x5b\x4a\x9f\x19\xe4\x35\x25\x04\xb8\x1d\x6e\x9a\x22\x4d\xfa\x37\x5d\x98\xc7\xde\xf8\x2d\x9f\x18\xe3\xbd\xa0\x41\xe6\x7b\x2a\x95\x5e\x97\x35\x65\xc4\x0f\xfe\x38\xd3\xe7\xe5\x22\xc3\x21\xd7\xde\x53\xef\x9b\xd9\x45\xdd\x5f\x7f\x79\x30\xff\xe6\x0d\xf8\x89\x7d\xf1\x52\x34\xbc\x6f\x6f\xd0\xcf\xad\xa4\x1a\xdc\xd9\x31\x51\x76\x31\x6a\x63\xd3\x76\xee\x73\xc7\x34\x80\x49\x67\x9f\x56\xa8\x99\x29\xce\xb1\x49\x4a\xf8\xe1\x62\x0f\x17\xd0\x7e\x68\xed\x66\x72\xbe\x8a\x33\xf1\xea\x87\x10\x4d\x8e\xb2\xf1\xc3\x09\x28\x07\x37\x8d\x67
|
2017-07-09 00:12:47 +00:00
|
|
|
|
|
|
|
func wikiCssBytes() ([]byte, error) {
|
|
|
|
return bindataRead(
|
|
|
|
_wikiCss,
|
|
|
|
"wiki.css",
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
func wikiCss() (*asset, error) {
|
|
|
|
bytes, err := wikiCssBytes()
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
2018-04-02 05:39:51 +00:00
|
|
|
info := bindataFileInfo{name: "wiki.css", size: 5727, mode: os.FileMode(420), modTime: time.Unix(1522646318, 0)}
|
2017-07-09 00:12:47 +00:00
|
|
|
a := &asset{bytes: bytes, info: info}
|
|
|
|
return a, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// Asset loads and returns the asset for the given name.
|
|
|
|
// It returns an error if the asset could not be found or
|
|
|
|
// could not be loaded.
|
|
|
|
func Asset(name string) ([]byte, error) {
|
|
|
|
cannonicalName := strings.Replace(name, "\\", "/", -1)
|
|
|
|
if f, ok := _bindata[cannonicalName]; ok {
|
|
|
|
a, err := f()
|
|
|
|
if err != nil {
|
|
|
|
return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err)
|
|
|
|
}
|
|
|
|
return a.bytes, nil
|
|
|
|
}
|
|
|
|
return nil, fmt.Errorf("Asset %s not found", name)
|
|
|
|
}
|
|
|
|
|
|
|
|
// MustAsset is like Asset but panics when Asset would return an error.
|
|
|
|
// It simplifies safe initialization of global variables.
|
|
|
|
func MustAsset(name string) []byte {
|
|
|
|
a, err := Asset(name)
|
|
|
|
if err != nil {
|
|
|
|
panic("asset: Asset(" + name + "): " + err.Error())
|
|
|
|
}
|
|
|
|
|
|
|
|
return a
|
|
|
|
}
|
|
|
|
|
|
|
|
// AssetInfo loads and returns the asset info for the given name.
|
|
|
|
// It returns an error if the asset could not be found or
|
|
|
|
// could not be loaded.
|
|
|
|
func AssetInfo(name string) (os.FileInfo, error) {
|
|
|
|
cannonicalName := strings.Replace(name, "\\", "/", -1)
|
|
|
|
if f, ok := _bindata[cannonicalName]; ok {
|
|
|
|
a, err := f()
|
|
|
|
if err != nil {
|
|
|
|
return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err)
|
|
|
|
}
|
|
|
|
return a.info, nil
|
|
|
|
}
|
|
|
|
return nil, fmt.Errorf("AssetInfo %s not found", name)
|
|
|
|
}
|
|
|
|
|
|
|
|
// AssetNames returns the names of the assets.
|
|
|
|
func AssetNames() []string {
|
|
|
|
names := make([]string, 0, len(_bindata))
|
|
|
|
for name := range _bindata {
|
|
|
|
names = append(names, name)
|
|
|
|
}
|
|
|
|
return names
|
|
|
|
}
|
|
|
|
|
|
|
|
// _bindata is a table, holding each asset generator, mapped to its name.
|
|
|
|
var _bindata = map[string]func() (*asset, error){
|
|
|
|
"highlight.js": highlightJs,
|
|
|
|
"wiki.css": wikiCss,
|
|
|
|
}
|
|
|
|
|
|
|
|
// AssetDir returns the file names below a certain
|
|
|
|
// directory embedded in the file by go-bindata.
|
|
|
|
// For example if you run go-bindata on data/... and data contains the
|
|
|
|
// following hierarchy:
|
|
|
|
// data/
|
|
|
|
// foo.txt
|
|
|
|
// img/
|
|
|
|
// a.png
|
|
|
|
// b.png
|
|
|
|
// then AssetDir("data") would return []string{"foo.txt", "img"}
|
|
|
|
// AssetDir("data/img") would return []string{"a.png", "b.png"}
|
|
|
|
// AssetDir("foo.txt") and AssetDir("notexist") would return an error
|
|
|
|
// AssetDir("") will return []string{"data"}.
|
|
|
|
func AssetDir(name string) ([]string, error) {
|
|
|
|
node := _bintree
|
|
|
|
if len(name) != 0 {
|
|
|
|
cannonicalName := strings.Replace(name, "\\", "/", -1)
|
|
|
|
pathList := strings.Split(cannonicalName, "/")
|
|
|
|
for _, p := range pathList {
|
|
|
|
node = node.Children[p]
|
|
|
|
if node == nil {
|
|
|
|
return nil, fmt.Errorf("Asset %s not found", name)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if node.Func != nil {
|
|
|
|
return nil, fmt.Errorf("Asset %s not found", name)
|
|
|
|
}
|
|
|
|
rv := make([]string, 0, len(node.Children))
|
|
|
|
for childName := range node.Children {
|
|
|
|
rv = append(rv, childName)
|
|
|
|
}
|
|
|
|
return rv, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type bintree struct {
|
|
|
|
Func func() (*asset, error)
|
|
|
|
Children map[string]*bintree
|
|
|
|
}
|
|
|
|
var _bintree = &bintree{nil, map[string]*bintree{
|
|
|
|
"highlight.js": &bintree{highlightJs, map[string]*bintree{}},
|
|
|
|
"wiki.css": &bintree{wikiCss, map[string]*bintree{}},
|
|
|
|
}}
|
|
|
|
|
|
|
|
// RestoreAsset restores an asset under the given directory
|
|
|
|
func RestoreAsset(dir, name string) error {
|
|
|
|
data, err := Asset(name)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
info, err := AssetInfo(name)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755))
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
err = ioutil.WriteFile(_filePath(dir, name), data, info.Mode())
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
err = os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime())
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// RestoreAssets restores an asset under the given directory recursively
|
|
|
|
func RestoreAssets(dir, name string) error {
|
|
|
|
children, err := AssetDir(name)
|
|
|
|
// File
|
|
|
|
if err != nil {
|
|
|
|
return RestoreAsset(dir, name)
|
|
|
|
}
|
|
|
|
// Dir
|
|
|
|
for _, child := range children {
|
|
|
|
err = RestoreAssets(dir, filepath.Join(name, child))
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func _filePath(dir, name string) string {
|
|
|
|
cannonicalName := strings.Replace(name, "\\", "/", -1)
|
|
|
|
return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...)
|
|
|
|
}
|
|
|
|
|