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
|
|
|
|
}
|
|
|
|
|
2017-11-18 02:05:12 +00:00
|
|
|
var _wikiCss = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xb4\x58\xdd\x6e\xe3\xba\x11\xbe\x4e\x80\xbc\xc3\x00\x41\x81\x36\xb0\x15\xc9\x89\xb3\x89\x5c\x14\x6d\x93\x2c\xda\xde\x9e\xc5\xb9\x5d\x50\x22\x2d\x71\x4d\x91\x3a\x24\x15\xdb\x1b\xe4\xdd\x0b\xfe\x49\x94\x2c\x6f\x4f\x8b\x6d\x16\x2b\x88\xe2\x68\xe6\x9b\x6f\xfe\x28\xdf\xde\xc0\x9e\xee\x68\x52\x2a\x05\x37\xb7\x57\x97\xb5\x6e\xd8\xa2\x10\xf8\x08\xef\x57\x97\x17\x05\x2a\x77\x95\x14\x1d\xc7\xf9\xbe\xa6\x9a\x6c\x4a\xc1\x84\xcc\x0b\x86\xca\xdd\x66\x2b\xb8\x5e\x2a\xfa\x9d\xe4\xd9\xaa\x3d\x6c\xae\x2e\x2f\x1a\x24\x2b\xca\xf3\x74\xd3\x22\x8c\x29\xaf\xf2\x74\x53\x08\x89\x89\xcc\xd3\xcd\xd5\xe5\x47\xa4\x7d\x41\x79\xdb\xe9\x77\xab\x62\x8b\x1a\xca\x8e\xf9\xaf\x44\x62\xc4\xd1\xe2\x6f\x92\x22\xb6\xf9\xb8\xba\xd4\xa8\x60\x64\xa1\xe5\x42\xe3\x85\xae\xe1\x3d\xa8\x6a\x0f\x66\xd7\x2a\x00\x80\xf7\x01\xc6\xa3\xdb\x41\xe0\xfe\xde\x35\x39\xe8\x25\x26\xa5\x90\x48\x53\xc1\x73\x2e\x78\xf0\x00\x0a\xd6\x11\x2b\x9c\xd7\xe2\x8d\xc8\x53\xe1\x8e\x63\x22\x19\xe5\x56\x8a\x36\x95\x53\x19\x61\x68\xd0\x61\xb9\xa7\x58\xd7\x79\x96\xa6\x7f\x30\x52\x1d\xf3\x86\x03\x0f\xed\x61\x03\x9e\x8a\x25\x23\x5b\x9d\xdf\x79\xf0\xf5\xca\x4b\x62\xaa\x5a\x86\x8e\x39\xe5\xc1\x54\x2b\x89\xdb\x8a\xb9\x79\x16\x5c\x09\x86\xd4\xe2\x59\x74\x92\x12\xb9\x68\x04\x17\xaa\x45\x25\x89\xa3\x90\x39\xe5\x1a\x7b\xe5\x7d\x14\xda\x03\x64\xde\x72\x52\x0a\xae\x09\xd7\xfd\xa6\x27\x2d\x51\x67\x48\x33\xb8\x96\xba\x96\xa2\xab\x6a\x27\xd8\x0a\xca\x88\x7c\x8f\x53\x61\xc8\x93\x65\xfc\x38\x12\x77\x34\xfb\x97\x5c\x2e\x7d\x5c\x5d\x5e\x5d\x26\xb4\xa9\x3a\xe9\x92\xcd\x71\x9b\xb5\x07\x50\x82\x51\x0c\x4e\xec\xea\xf2\xc2\xd1\xfc\x94\xba\x2c\xab\x09\xad\x6a\xdd\x2f\x45\x8b\x4a\xaa\x8f\x79\x9a\x3c\x98\xe5\xb2\x11\xdf\x97\x5a\x22\xae\xa8\xc5\x8f\x18\x83\x34\xc9\x14\x18\x47\x90\xb4\x22\x7b\x52\xec\xa8\xfe\xb1\xd4\x47\xc0\x16\x12\x24\xd8\x81\x2c\x49\x1d\xf6\xdb\x1b\xf8\x07\x41\x98\x48\x5b\x39\x49\xed\xee\x27\x75\x73\xfd\xf2\xf2\x62\x8c\x06\xbe\xef\x1c\xea\x21\x6c\xde\x8d\x42\x1c\x96\xaa\x46\x58\xec\x73\x30\x01\xbb\x6f\x0f\xb0\x32\x97\xeb\xe7\xe7\x67\x23\x70\x7b\xd3\x8a\x80\xb6\x50\x82\x75\x8e\x1b\x9b\x57\xe9\x46\x5a\x4e\xd2\x8d\x41\xf2\x31\x80\x41\xe7\xe0\xb8\x40\x54\x92\x1c\xcd\x6a\x1a\x74\xb0\xa5\x12\x55\xb4\x01\x13\x70\x4e\xa2\x14\x34\x8e\x53\x79\x59\x30\x51\xee\xa2\x70\x65\x0f\xee\xfd\xc0\xc3\xaa\x3d\x80\xe7\xe2\x67\x86\x2c\xf8\x1d\xa2\x36\xd7\xc4\x7a\xf7\x5d\x96\xce\x39\x35\xd9\x59\x0e\x74\xb9\x2d\x7f\xf5\xfc\xd9\x5c\xe1\x5b\x61\xcd\x05\x1e\x7a\x02\x4e\x94\x63\x24\x77\x81\xf9\x98\x8e\xfb\x51\x17\x35\x15\x0b\x6b\xf7\x68\x0a\x77\x5a\x6e\xcc\x50\x7c\x24\x8c\x89\xbd\x83\x63\x93\xf3\x15\x53\x2d\x24\xb4\xa8\x22\x36\x43\xb7\x94\x30\xac\x88\xee\xdb\xd8\x00\xc9\xc2\xf9\x88\x44\x18\xa9\x08\xc7\xd6\xa1\x18\xe2\x83\x4b\x04\xf0\xc1\x9c\x49\xac\x79\xd5\x21\xe3\xf7\x2e\x19\x0a\xc1\xb0\xe7\x8d\x38\x90\xb1\xa1\x74\x3c\x4d\xdc\xea\x8d\x48\x4d\x4b\xc4\x96\x88\xd1\x8a\xe7\x5a\xb4\x4e\xc1\xb5\x6f\x68\xa5\x3e\xe9\x22\x18\xa9\x9a\x60\xb0\xe4\xf4\x7c\xcf\xd5\x90\x16\x6d\x9e\xad\x8c\x21\x57\x46\xb6\x59\x16\x42\x6b\xd1\xb8\x7b\x5b\x64\x99\x43\x12\x81\x36\x65\x83\x24\x71\x45\xf6\xdf\xf7\xeb\xf4\xf7\x4c\xcd\x8b\xbe\xff\xd9\x31\x13\xaa\xc9\xdc\x9b\x77\x29\x8f\x87\x90\x59\xc6\x12\x70\x7b\x03\x5c\x80\x24\xc6\xa0\xcd\x81\x8b\xc9\xd8\x32\xcb\x89\xce\x53\x8a\x8c\x9a\x7f\xbe\x7e\x82\xd0\x5c\xb6\xb2\x99\xef\xd8\x7d\x12\x44\x79\xf1\xfa\xfa\x3a\x6e\x78\xc1\xef\xe0\xee\x7a\x44\xc3\xda\x0f\x2b\x7f\x59\x07\xce\x6d\x46\x7f\x31\x47\x02\x05\x94\x83\x8f\xba\xeb\xbc\x9a\x46\xc3\xd9\x94\x04\x43\xad\x22\x39\x84\xbb\x0d\xf8\x2d\xa5\x8f\x8c\xe4\x35\xc5\x98\x70\x3b\x9d\x34\x05\x8d\xfb\x37\x5d\x98\xc7\xde\xf8\x2d\x9f\x18\xe3\xbd\xa0\x41\xe6\x5b\x2a\x95\x5e\x96\x35\x65\xd8\x4f\xee\x38\xd3\xe7\xe5\x22\xc3\x21\xd7\xce\xa9\xf7\xcd\xec\xa4\xee\xaf\x3f\x3f\x9a\x7f\xf3\x06\xfc\xc8\x3d\x79\x29\x9a\xbe\xb7\x37\xf0\x4b\x2b\xa9\x26\xee\xf0\x97\x28\xbb\x18\xb5\xb1\x69\x3b\xf7\xb9\x63\x1a\xc0\xa4\xb3\x4f\x2b\xd4\xcc\x14\xe7\xd8\x24\x25\xfc\x70\xb1\xa7\x03\xd2\xfe\xd0\xda\xcd\xe4\x80\x14\x67\xe2\xc5\x77\x21\x9a\x1c\xb2\xf1\xc3\x09\x28\x07\x37\x8d\x67\xd7\x34\xcc\x71\x3b\xfe\x51\xb4\xc7\xe3\xf0\x3e\x24\xa6\xe1\x90\x94\xa6
|
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
|
|
|
|
}
|
|
|
|
|
2017-11-18 02:05:12 +00:00
|
|
|
info := bindataFileInfo{name: "wiki.css", size: 5664, mode: os.FileMode(420), modTime: time.Unix(1510970358, 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, "/")...)...)
|
|
|
|
}
|
|
|
|
|