graphql-engine/cli/assets/assets.go
Aravind Shankar 260d565e6e cli: tests for metadata commands (#18)
* [cli] added urlPrefix, consoleMode

* [cli] fix: down=all should throw error if down migration is missing

* [cli] added tests for metadata
2018-06-29 15:32:33 +05:30

238 lines
8.2 KiB
Go

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