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