quintodrome/static/bindata.go

353 lines
237 KiB
Go
Raw Normal View History

// Package static Code generated by go-bindata. (@generated) DO NOT EDIT.
// sources:
2020-01-24 19:42:47 -09:00
// banner.txt
// default_cover.jpg
// navidrone-310x310.png
package static
import (
"bytes"
"fmt"
"io/ioutil"
"net/http"
"os"
"path/filepath"
"strings"
"time"
)
type asset struct {
bytes []byte
info os.FileInfo
}
type bindataFileInfo struct {
name string
size int64
mode os.FileMode
modTime time.Time
}
// Name return file name
func (fi bindataFileInfo) Name() string {
return fi.name
}
// Size return file size
func (fi bindataFileInfo) Size() int64 {
return fi.size
}
// Mode return file mode
func (fi bindataFileInfo) Mode() os.FileMode {
return fi.mode
}
// ModTime return file modify time
func (fi bindataFileInfo) ModTime() time.Time {
return fi.modTime
}
// IsDir return file whether a directory
func (fi bindataFileInfo) IsDir() bool {
return fi.mode&os.ModeDir != 0
}
// Sys return file is sys mode
func (fi bindataFileInfo) Sys() interface{} {
return nil
}
type assetFile struct {
*bytes.Reader
name string
childInfos []os.FileInfo
childInfoOffset int
}
type assetOperator struct{}
// Open implement http.FileSystem interface
func (f *assetOperator) Open(name string) (http.File, error) {
var err error
if len(name) > 0 && name[0] == '/' {
name = name[1:]
}
content, err := Asset(name)
if err == nil {
return &assetFile{name: name, Reader: bytes.NewReader(content)}, nil
}
children, err := AssetDir(name)
if err == nil {
childInfos := make([]os.FileInfo, 0, len(children))
for _, child := range children {
childPath := filepath.Join(name, child)
info, errInfo := AssetInfo(filepath.Join(name, child))
if errInfo == nil {
childInfos = append(childInfos, info)
} else {
childInfos = append(childInfos, newDirFileInfo(childPath))
}
}
return &assetFile{name: name, childInfos: childInfos}, nil
} else {
// If the error is not found, return an error that will
// result in a 404 error. Otherwise the server returns
// a 500 error for files not found.
if strings.Contains(err.Error(), "not found") {
return nil, os.ErrNotExist
}
return nil, err
}
}
// Close no need do anything
func (f *assetFile) Close() error {
return nil
}
// Readdir read dir's children file info
func (f *assetFile) Readdir(count int) ([]os.FileInfo, error) {
if len(f.childInfos) == 0 {
return nil, os.ErrNotExist
}
if count <= 0 {
return f.childInfos, nil
}
if f.childInfoOffset+count > len(f.childInfos) {
count = len(f.childInfos) - f.childInfoOffset
}
offset := f.childInfoOffset
f.childInfoOffset += count
return f.childInfos[offset : offset+count], nil
}
// Stat read file info from asset item
func (f *assetFile) Stat() (os.FileInfo, error) {
if len(f.childInfos) != 0 {
return newDirFileInfo(f.name), nil
}
return AssetInfo(f.name)
}
// newDirFileInfo return default dir file info
func newDirFileInfo(name string) os.FileInfo {
return &bindataFileInfo{
name: name,
size: 0,
mode: os.FileMode(2147484068), // equal os.FileMode(0644)|os.ModeDir
modTime: time.Time{}}
}
// AssetFile return a http.FileSystem instance that data backend by asset
func AssetFile() http.FileSystem {
return &assetOperator{}
}
2020-01-24 19:42:47 -09:00
var _bannerTxt = []byte(` _ _ _ _
| \ | | (_) | |
| \| | __ ___ ___ __| |_ __ ___ _ __ ___ ___
| . ` + "`" + ` |/ _` + "`" + ` \ \ / / |/ _` + "`" + ` | '__/ _ \| '_ ` + "`" + ` _ \ / _ \
| |\ | (_| |\ V /| | (_| | | | (_) | | | | | | __/
\_| \_/\__,_| \_/ |_|\__,_|_| \___/|_| |_| |_|\___|
`)
func bannerTxtBytes() ([]byte, error) {
return _bannerTxt, nil
}
func bannerTxt() (*asset, error) {
bytes, err := bannerTxtBytes()
if err != nil {
return nil, err
}
2020-03-20 08:00:14 -08:00
info := bindataFileInfo{name: "banner.txt", size: 266, mode: os.FileMode(420), modTime: time.Unix(1584587926, 0)}
2020-01-24 19:42:47 -09:00
a := &asset{bytes: bytes, info: info}
return a, nil
}
var _default_coverJpg = []byte("\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x01\x0e\x00\x00\x01\x0e\b\x02\x00\x00\x00\xf7\xd3n\xf2\x00\x00\x00\x19tEXtSoftware\x00Adobe ImageReadyq\xc9e<\x00\x00W\xe3IDATx\xda\xec}y\xb0mYY\xdf\xda\xc3}\xef5o\xec\xd7M\xa31\f\xdd4\xa0\"4\"\xdd\u0400\f\xcddB\x83h\xa21\u0454b\xa2\xa9\xb2*e*\xf9#\u007f\xa4ReU*&U\x89IID\v\x055A\x19dtf\x12\x88`\xa5\r\x04hh\xa0er(\x81\xa6\xfb\xf5\xeb\xe9u\xbf\xf7\xee\xd9C\xd6\xd9\xeb\x9cu\xbe\xbd\xbea}k\xed}\uef6d\xef\u052d[\xe7\x9e{\xce>{\xaf\xbd~\xeb\xf7\xfd\xbei\x15\xef\xfd\xe8'\xbb\xbe/\x8b\xc2\x18SV\xa5\x19\x1euQ4}_\x97\xcb?\xab\xaaj\xdb\xd6\xfe^\xfd\xab,\x9b\xae\xab\xab\xaa,\x97\x1f1\x85\xe9\u06be\xaa\x8a\u0798\x9d\xaaj\xba~xOQ\x14e\xdfw\xf6w]\x99\xa65\xab\xcf\xd6\xeb\x83\xd8c\xf6\xfdp\xf0\u00ac\x1f\xe5\xea_u\xdbw\xeb\xb7-_\xeb\x97_R\xfa\xf7t\xebw\x96E\xe9?[\u056b\xe7\xd5p\xcee\xb9y\xb7\xfdU\xda\xffv\xc3\a\xcb\xcdG\xe0\x97\xaeO\x0f\xfe\xb5:U\xff\x89\xb2\xb2W\xbay\x1e<*\x13\x1e9\xfc\x82\xce\xec\xecTF\xfdX\xb4\xad\xff \xf9h\x87\u007f\xd8\xebm\xbb\xd5;\xfc\xe9\x05\x8f\xf5\xff7\xffn\x9a\xce_\xaf}\u0785\xef\xef\xfcY\xbb\u007f\xda_v\x1c\xdc\xfbZ\xf8\xf6\xaek\xd7_>\xdc\xf9\xd5\u0256\xc3\xe9\u067b\xd6\x0f/\xb4\xed\xe6#\xbd?[\u007f!m?|d\xf9%\xee\xbf\xcdz\xc6\xd8\t\u0434vzv\xeb\x93\xe9W\a\xb1Sk\x98\x18\xc3\x1f\xcb\xefnZ\xfa\xe2\xdb\xe1\xf5\xe5\x8cu\xf3v\x98\xd8\xf6\xa4\xfd\xe5\u0623\xc3+\xea\xc0 \xb6\xcdz\xe0\xba>\x98*\x97\x1e\xdb|\xa4\x8c\xf4\x82\xb9\xf1\x97\x1e\x0f\x93\x1bx\xe91atw\xaa\x04J\x19\xbd\xf9\xd2-\xba\x04\x95\x83\xf0\x18\x1b]3<Z\xce`\xba\xf4\xb8\x04\x95K\x8fK\x8fKP\xf9\x9b\xffh\x9a\x99I\xa0\xba\xb4\xfa\\\x82\u02a5G\xf2\xa3\xcbT\xea\xa37_2\xe8\x0e\x88\xad~i\b\xf6\x0e6U\"H.=\x0e\x14\xabtC|c\xf5\xbb%V0\x18T\xd9\xd8-\xeb;\u06b5\xfd\xe6\xc5n\xf3|\xe3\v\xa7n}\xdb\xf7UQ\xb8\xa0J\xb9\xfe\xb1\x8f\xa2\xb4\xefo\x96fLQV\xc5*\xa8\x12\xcc7\x92\a\xabu\xf8c\xec\xf5\x0f\x9ft\xab(A\x97\xb1d\vA\x15\xa7\xe6#\x82\xbe\\\xc2 \x8a\x84\x9d\xaar?\xb2\xe7\xc0\u007fW;\x0e\x8a\xd8ss?\x9b\xd3\xee$\xe3\x13\aUF\x97L\xfd\xd3\r\xf52\x9e\xd3l\u62ff\xf3\xf0\xee\xf4\xcb\u040a)\xe0g\x8bU0\xac\x037}x\xbd\xf0A\x95\xf14\v_\xa9\u02e2.\x8bph\xed\x8bU\xb5\xfc\x01q\xb3vx\x80\xb3Y\x9e\xa2\v\xaa\xf8aq\u04de\xb5\xa57\xc1\xba\xe2\x12\xab\xec\x95\rV\xf2(\x97Y%\xcb\xfa\xea\xfe\xd60\x93]\xa9\xcb5r\xec\xf2]\x97[\x14\x14\xfb\xa9U\u06b6\x97\xdf\u040b\x13\xa5\x13\xff-\xac\x96%3\xa0c\x89\xdfF\x8fC\xae\xf7\u0451\x16\xb8e\nNb\xf0h\x95\x9e\f\x92I\xf43P>\xe5\xb6o\x1eF8l\xc7\x03\xb5N\x18)\x8a\x19\xbf\x03& \xcc2\u010a\xab\u02bf\a\xfb\"\x9b\x03Thl\xb38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vn\xa1\xbf\x15\xa8\xc0\xb0\xfd\x9e\xd1w\xabN|\x8cb&)\x87\u04af\xee[\x92\x16\xc2A:\xa5{9gi\x98\xe0\u0741k\x04U\xff\xb8\xf7\x8ff\xdaWo<`\x90\x89\xa6x\xc0\u0316}vY\xf6\xe5fQ,Es\xa4\x8bM5\x8eX4\x86S^\xba1\x99,\xc3V\x05\xb7\x12\x0f\xcc(\xeb\xabz\xef\\A\xd0\xea\xc9[\u007f\xb3q\x82W\u07bd\xb8\xec\f\x1b\x8c\\\x81H'\x18t\u02c0b\xe8\xae\xed:l\x80u\x1b\xa1\x95C,{\xb9,rd\xb2\xd1$\xad\xc6\xe6T\xbb\x89\xc1\x98\x8cr\xe4\u0517\xdcma\xce\xe0\x99\xd3\xef_\xb8S\v\x95v\xff\xe8\xa2\xd5\x11]
func default_coverJpgBytes() ([]byte, error) {
return _default_coverJpg, nil
}
func default_coverJpg() (*asset, error) {
bytes, err := default_coverJpgBytes()
if err != nil {
return nil, err
}
info := bindataFileInfo{name: "default_cover.jpg", size: 22593, mode: os.FileMode(420), modTime: time.Unix(1584578825, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
var _navidrone310x310Png = []byte("\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x016\x00\x00\x016\b\x06\x00\x00\x00\ubf3e\xa9\x00\x00\x00\x04gAMA\x00\x00\xb1\x8f\v\xfca\x05\x00\x00\x00\x01sRGB\x00\xae\xce\x1c\xe9\x00\x00\x00 cHRM\x00\x00z&\x00\x00\x80\x84\x00\x00\xfa\x00\x00\x00\x80\xe8\x00\x00u0\x00\x00\xea`\x00\x00:\x98\x00\x00\x17p\x9c\xbaQ<\x00\x00\x00\x06bKGD\x00\xff\x00\xff\x00\xff\xa0\xbd\xa7\x93\x00\x00\x00\tpHYs\x00\x00\x00H\x00\x00\x00H\x00F\xc9k>\x00\x00\x80\x00IDATx\xda\xec\xfdy\xb0/\u0255\u07c7}NU\xfd\x96\xbb\xbc\xfb\x96~\xbd\xaf\xe8\xc6>\xc0\x00\x18\x003\x03n\xa3\xe1\u0310\xb2\xa9\x10\x15Z(R2\xc9\x11E\x86\x18TX\x94\u00cb\x96\xb0\x14f\x84,\xeb/\x87i\xcb\fY\x96-;\xecp\xd8\n\x87\x14\x8apH\x96(\x99\x8b\xb8h8\x9a\xc1`\x06\xc0`\x1d\x00\r\xf4\xfe\xba\xdfr\xb7\xdfR\x95\xc7\u007fde\xd6\u026c\xac\xdf}@\xbfF7\x80\x9b\u077fw\u007f\xbf\xaa\xac\xac\\\xbf\xf9='O\x9e\x84\xcbp\x19.\xc3e\xb8\f\x97\xe12\\\x86\xcbp\x19.\xc3e\xb8\f\x97\xe12\\\x86\xcbp\x19.\xc3e\xb8\f\x97\xe12\\\x86\xcbp\x19.\xc3e\xb8\f\x97\xe12\\\x86\xcbp\x19.\xc3e\xb8\f\x97\xe12\\\x86\xcbp\x19.\xc3e\xb8\f\x97\xe12\\\x86\xcbp\x19.\xc3e\xb8\f\x97\xe12\\\x86\xcbp\x19.\xc3e\xb8\f\x97\xe12\\\x86\xcbp\x19.\xc3;\x13\xe4\xdd\xce\xc0e\xf8\x11\t\u007f\xf6+\x80\x80\xce@\x05p\xd0\xe1?\xf8[\xd4\x02U\xff[\xfb\x8b* \x1a.\xf4\xf7t\xf8)\x80\x13h\x81N\xfdG\x14\x99\x01sA\xdb\n\x1c \xce\xc7\xff\x8f\xde\xffn\xd7\xc4e\xf8\x11\b\x97\xc0\xf6\x93\x1c\xfe\x8d\u05d1\x17\xcf`\xeb\xd0N=\xe0\b\xa0\x0e:\x87\xd4\x02\x8d\xa0\"\x1e|Njx\xae\x81S'\xb8\x0e\xb6*\xb4}\x1f\xaa\x10j\x91\xfe\x97\xffW\x05T\xa4\bl\xf6\x82\x13\xa5\x05Z\xa78\u007fS\xe6(sT7\x02\xe7N\xb9\xb6\x84v\xdb?\xdb\xe7'$\xe3\x1c\xb4=\xf0IHz\v\xff\xe9\xc7\xdf\xed\x1a\xbe\f\xefRh\xde\xed\f\\\x86\x1f\x91 \xc0\xc2\xc1\xff\xed\x9b\xf0\u03fc_Xu\r\xbe\xff4(\xb3\xf8]h\x80\x1a\xa5\xc6\xf371\x1f\xf0\xa8\xa3x\x1e\xe6\x10\x1c\x9e\xf7\xb5@\x8b\u0482n\x81V\x84\x96\u03b5\xfa\vO*\x9f\u007f#\xc1\xc6\xcbp\x19v\x85K\xc6\xf6c\x1e\xe4O\u007f#|\x03\xa4'K\xe0\x99\xce\xf0\xa9]-\x1d\xae\xa1\xa2AuN\xebf\xd2\u0202\x99\xccUd\x0e,p,PY\x00\v\x90\x05\xb0\x04Y\xa0:\a\xe6T2\x03f=\xb85 \x95\xffh/\x93\xf6/V\x14\xd5\x00h\x1dJ\x8bc\x8bc\x83\xb2\x05\xd64\xac\xa9e\x8d\xc8\x1ae\x8d\xea\nuk`\x03\xb2\xc1\xc9\x1a\xc7\x06tC\u7dac\xda-\xdf;\xee\xf8\xd9\u01d4M\xebEZ\xa7\x03\xb3\xab\x02\x9e\xf6\x15\xf0\x1f}\xf0\xddn\x9a\xcb\xf0\x0e\x86K\xc6\xf6\x93\x15,s\x12*\x0f<\"2\xeb*\xddC\xe5\x00\xb8\x02zD%\xd7T\xb8&p\x1d\xb8\x8ar\x158\x02\xae\xa0\x1c \xec\x83,\x81%0\af=KkPjDj\xbc`Z\x81\xf4\xa2i\x0f*\x1e\xda<c\x03\x87\xf6\x8cMh\x81-\xc2\x06\x915\xc8\n\xe4\x14\xf4\x148\x06\xb9\az\x17\xb8\x8bp\x1b\xe1\x0ep\x87\x9a{,\xebc\xde\u007f\ud53b\xeb\x15\x8dl\xa9\xe8H\x90\x8cL\x1e\xbe\f?\xce\u14b1\xfd\x98\x84\xfd_\xb8\xc5\xfa\x89\x13\u072c\xd7\u6ae0\x81$I\xc5\ry\x83;zc\xe9\x94\x03\xe0\b\xf4\x1a\xaa7p\\G\xe5:\x1e\xc0\xae\x83^E\xf5\bu\x87\b\x87T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e\x9f\xbf\xb5\xe6s\x8f(on\xde\ud5bc\f\x0f \\2\xb6\x1f\x81 \xff\xe4\xef!\u02ea'L\x83\xcah\xd9\xcee\xddl\xf7U\xf4\b\xb8\x8ep\x13\x95GA\x1f\u00c3\xda\xe3 \x8f\"<\f\u
func navidrone310x310PngBytes() ([]byte, error) {
return _navidrone310x310Png, nil
}
func navidrone310x310Png() (*asset, error) {
bytes, err := navidrone310x310PngBytes()
if err != nil {
return nil, err
}
info := bindataFileInfo{name: "navidrone-310x310.png", size: 62296, mode: os.FileMode(420), modTime: time.Unix(1584578827, 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){
"banner.txt": bannerTxt,
"default_cover.jpg": default_coverJpg,
"navidrone-310x310.png": navidrone310x310Png,
}
// 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{
"banner.txt": &bintree{bannerTxt, map[string]*bintree{}},
"default_cover.jpg": &bintree{default_coverJpg, map[string]*bintree{}},
"navidrone-310x310.png": &bintree{navidrone310x310Png, 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, "/")...)...)
}