Files
ent/entc/load/internal/bindata.go
Ariel Mashraki 829de26c4f entc/load: add the default value for schema fields when possible (#170)
Summary:
Pull Request resolved: https://github.com/facebookincubator/ent/pull/170

Used to verify enum default values in the genrator

Reviewed By: alexsn

Differential Revision: D18561625

fbshipit-source-id: fde153a042d2e7b6da7f7d2c5b045c93266e276f
2019-11-17 09:06:58 -08:00

270 lines
16 KiB
Go

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