Serge Bazanski | be538db | 2020-11-12 00:22:42 +0100 | [diff] [blame] | 1 | // Code generated by go-bindata. |
| 2 | // sources: |
| 3 | // ../lib/kubecfg.libsonnet |
| 4 | // DO NOT EDIT! |
| 5 | |
| 6 | package utils |
| 7 | |
| 8 | import ( |
| 9 | "bytes" |
| 10 | "compress/gzip" |
| 11 | "fmt" |
| 12 | "io" |
| 13 | "io/ioutil" |
| 14 | "os" |
| 15 | "path/filepath" |
| 16 | "strings" |
| 17 | "time" |
| 18 | ) |
| 19 | |
| 20 | func bindataRead(data []byte, name string) ([]byte, error) { |
| 21 | gz, err := gzip.NewReader(bytes.NewBuffer(data)) |
| 22 | if err != nil { |
| 23 | return nil, fmt.Errorf("Read %q: %v", name, err) |
| 24 | } |
| 25 | |
| 26 | var buf bytes.Buffer |
| 27 | _, err = io.Copy(&buf, gz) |
| 28 | clErr := gz.Close() |
| 29 | |
| 30 | if err != nil { |
| 31 | return nil, fmt.Errorf("Read %q: %v", name, err) |
| 32 | } |
| 33 | if clErr != nil { |
| 34 | return nil, err |
| 35 | } |
| 36 | |
| 37 | return buf.Bytes(), nil |
| 38 | } |
| 39 | |
| 40 | type asset struct { |
| 41 | bytes []byte |
| 42 | info os.FileInfo |
| 43 | } |
| 44 | |
| 45 | type bindataFileInfo struct { |
| 46 | name string |
| 47 | size int64 |
| 48 | mode os.FileMode |
| 49 | modTime time.Time |
| 50 | } |
| 51 | |
| 52 | func (fi bindataFileInfo) Name() string { |
| 53 | return fi.name |
| 54 | } |
| 55 | func (fi bindataFileInfo) Size() int64 { |
| 56 | return fi.size |
| 57 | } |
| 58 | func (fi bindataFileInfo) Mode() os.FileMode { |
| 59 | return fi.mode |
| 60 | } |
| 61 | func (fi bindataFileInfo) ModTime() time.Time { |
| 62 | return fi.modTime |
| 63 | } |
| 64 | func (fi bindataFileInfo) IsDir() bool { |
| 65 | return false |
| 66 | } |
| 67 | func (fi bindataFileInfo) Sys() interface{} { |
| 68 | return nil |
| 69 | } |
| 70 | |
| 71 | 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") |
| 72 | |
| 73 | func libKubecfgLibsonnetBytes() ([]byte, error) { |
| 74 | return bindataRead( |
| 75 | _libKubecfgLibsonnet, |
| 76 | "lib/kubecfg.libsonnet", |
| 77 | ) |
| 78 | } |
| 79 | |
| 80 | func libKubecfgLibsonnet() (*asset, error) { |
| 81 | bytes, err := libKubecfgLibsonnetBytes() |
| 82 | if err != nil { |
| 83 | return nil, err |
| 84 | } |
| 85 | |
| 86 | info := bindataFileInfo{name: "lib/kubecfg.libsonnet", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} |
| 87 | a := &asset{bytes: bytes, info: info} |
| 88 | return a, nil |
| 89 | } |
| 90 | |
| 91 | // Asset loads and returns the asset for the given name. |
| 92 | // It returns an error if the asset could not be found or |
| 93 | // could not be loaded. |
| 94 | func Asset(name string) ([]byte, error) { |
| 95 | cannonicalName := strings.Replace(name, "\\", "/", -1) |
| 96 | if f, ok := _bindata[cannonicalName]; ok { |
| 97 | a, err := f() |
| 98 | if err != nil { |
| 99 | return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err) |
| 100 | } |
| 101 | return a.bytes, nil |
| 102 | } |
| 103 | return nil, fmt.Errorf("Asset %s not found", name) |
| 104 | } |
| 105 | |
| 106 | // MustAsset is like Asset but panics when Asset would return an error. |
| 107 | // It simplifies safe initialization of global variables. |
| 108 | func MustAsset(name string) []byte { |
| 109 | a, err := Asset(name) |
| 110 | if err != nil { |
| 111 | panic("asset: Asset(" + name + "): " + err.Error()) |
| 112 | } |
| 113 | |
| 114 | return a |
| 115 | } |
| 116 | |
| 117 | // AssetInfo loads and returns the asset info for the given name. |
| 118 | // It returns an error if the asset could not be found or |
| 119 | // could not be loaded. |
| 120 | func AssetInfo(name string) (os.FileInfo, error) { |
| 121 | cannonicalName := strings.Replace(name, "\\", "/", -1) |
| 122 | if f, ok := _bindata[cannonicalName]; ok { |
| 123 | a, err := f() |
| 124 | if err != nil { |
| 125 | return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err) |
| 126 | } |
| 127 | return a.info, nil |
| 128 | } |
| 129 | return nil, fmt.Errorf("AssetInfo %s not found", name) |
| 130 | } |
| 131 | |
| 132 | // AssetNames returns the names of the assets. |
| 133 | func AssetNames() []string { |
| 134 | names := make([]string, 0, len(_bindata)) |
| 135 | for name := range _bindata { |
| 136 | names = append(names, name) |
| 137 | } |
| 138 | return names |
| 139 | } |
| 140 | |
| 141 | // _bindata is a table, holding each asset generator, mapped to its name. |
| 142 | var _bindata = map[string]func() (*asset, error){ |
| 143 | "lib/kubecfg.libsonnet": libKubecfgLibsonnet, |
| 144 | } |
| 145 | |
| 146 | // AssetDir returns the file names below a certain |
| 147 | // directory embedded in the file by go-bindata. |
| 148 | // For example if you run go-bindata on data/... and data contains the |
| 149 | // following hierarchy: |
| 150 | // data/ |
| 151 | // foo.txt |
| 152 | // img/ |
| 153 | // a.png |
| 154 | // b.png |
| 155 | // then AssetDir("data") would return []string{"foo.txt", "img"} |
| 156 | // AssetDir("data/img") would return []string{"a.png", "b.png"} |
| 157 | // AssetDir("foo.txt") and AssetDir("notexist") would return an error |
| 158 | // AssetDir("") will return []string{"data"}. |
| 159 | func AssetDir(name string) ([]string, error) { |
| 160 | node := _bintree |
| 161 | if len(name) != 0 { |
| 162 | cannonicalName := strings.Replace(name, "\\", "/", -1) |
| 163 | pathList := strings.Split(cannonicalName, "/") |
| 164 | for _, p := range pathList { |
| 165 | node = node.Children[p] |
| 166 | if node == nil { |
| 167 | return nil, fmt.Errorf("Asset %s not found", name) |
| 168 | } |
| 169 | } |
| 170 | } |
| 171 | if node.Func != nil { |
| 172 | return nil, fmt.Errorf("Asset %s not found", name) |
| 173 | } |
| 174 | rv := make([]string, 0, len(node.Children)) |
| 175 | for childName := range node.Children { |
| 176 | rv = append(rv, childName) |
| 177 | } |
| 178 | return rv, nil |
| 179 | } |
| 180 | |
| 181 | type bintree struct { |
| 182 | Func func() (*asset, error) |
| 183 | Children map[string]*bintree |
| 184 | } |
| 185 | var _bintree = &bintree{nil, map[string]*bintree{ |
| 186 | "lib": &bintree{nil, map[string]*bintree{ |
| 187 | "kubecfg.libsonnet": &bintree{libKubecfgLibsonnet, map[string]*bintree{}}, |
| 188 | }}, |
| 189 | }} |
| 190 | |
| 191 | // RestoreAsset restores an asset under the given directory |
| 192 | func RestoreAsset(dir, name string) error { |
| 193 | data, err := Asset(name) |
| 194 | if err != nil { |
| 195 | return err |
| 196 | } |
| 197 | info, err := AssetInfo(name) |
| 198 | if err != nil { |
| 199 | return err |
| 200 | } |
| 201 | err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755)) |
| 202 | if err != nil { |
| 203 | return err |
| 204 | } |
| 205 | err = ioutil.WriteFile(_filePath(dir, name), data, info.Mode()) |
| 206 | if err != nil { |
| 207 | return err |
| 208 | } |
| 209 | err = os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime()) |
| 210 | if err != nil { |
| 211 | return err |
| 212 | } |
| 213 | return nil |
| 214 | } |
| 215 | |
| 216 | // RestoreAssets restores an asset under the given directory recursively |
| 217 | func RestoreAssets(dir, name string) error { |
| 218 | children, err := AssetDir(name) |
| 219 | // File |
| 220 | if err != nil { |
| 221 | return RestoreAsset(dir, name) |
| 222 | } |
| 223 | // Dir |
| 224 | for _, child := range children { |
| 225 | err = RestoreAssets(dir, filepath.Join(name, child)) |
| 226 | if err != nil { |
| 227 | return err |
| 228 | } |
| 229 | } |
| 230 | return nil |
| 231 | } |
| 232 | |
| 233 | func _filePath(dir, name string) string { |
| 234 | cannonicalName := strings.Replace(name, "\\", "/", -1) |
| 235 | return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...) |
| 236 | } |
| 237 | |