This repository has been archived on 2019-06-23. You can view files and clone it, but cannot push or open issues or pull requests.
mumbledj/bindata.go
2016-06-20 17:16:05 -07:00

236 lines
15 KiB
Go

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