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