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