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