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