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