Files
ent/entc/load/internal/bindata.go
Ariel Mashraki b64330e475 ent/gen: remove redundant nillable check
Summary: nillable must be optional

Reviewed By: alexsn

Differential Revision: D17763004

fbshipit-source-id: 9c134e1648d1a387d90a5f2353de855a1aa3464f
2019-10-05 11:03:05 -07:00

270 lines
16 KiB
Go

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