| 1 | // Code generated by go-bindata. DO NOT EDIT. |
| 2 | // sources: |
| 3 | // tengo/outmessage.tengo |
| 4 | |
| 5 | package internal |
| 6 | |
| 7 | import ( |
| 8 | "bytes" |
| 9 | "compress/gzip" |
| 10 | "fmt" |
| 11 | "io" |
| 12 | "os" |
| 13 | "path/filepath" |
| 14 | "strings" |
| 15 | "time" |
| 16 | ) |
| 17 | |
| 18 | func bindataRead(data []byte, name string) ([]byte, error) { |
| 19 | gz, err := gzip.NewReader(bytes.NewBuffer(data)) |
| 20 | if err != nil { |
| 21 | return nil, fmt.Errorf("Read %q: %v", name, err) |
| 22 | } |
| 23 | |
| 24 | var buf bytes.Buffer |
| 25 | _, err = io.Copy(&buf, gz) |
| 26 | clErr := gz.Close() |
| 27 | |
| 28 | if err != nil { |
| 29 | return nil, fmt.Errorf("Read %q: %v", name, err) |
| 30 | } |
| 31 | if clErr != nil { |
| 32 | return nil, err |
| 33 | } |
| 34 | |
| 35 | return buf.Bytes(), nil |
| 36 | } |
| 37 | |
| 38 | type asset struct { |
| 39 | bytes []byte |
| 40 | info fileInfoEx |
| 41 | } |
| 42 | |
| 43 | type fileInfoEx interface { |
| 44 | os.FileInfo |
| 45 | MD5Checksum() string |
| 46 | } |
| 47 | |
| 48 | type bindataFileInfo struct { |
| 49 | name string |
| 50 | size int64 |
| 51 | mode os.FileMode |
| 52 | modTime time.Time |
| 53 | md5checksum string |
| 54 | } |
| 55 | |
| 56 | func (fi bindataFileInfo) Name() string { |
| 57 | return fi.name |
| 58 | } |
| 59 | func (fi bindataFileInfo) Size() int64 { |
| 60 | return fi.size |
| 61 | } |
| 62 | func (fi bindataFileInfo) Mode() os.FileMode { |
| 63 | return fi.mode |
| 64 | } |
| 65 | func (fi bindataFileInfo) ModTime() time.Time { |
| 66 | return fi.modTime |
| 67 | } |
| 68 | func (fi bindataFileInfo) MD5Checksum() string { |
| 69 | return fi.md5checksum |
| 70 | } |
| 71 | func (fi bindataFileInfo) IsDir() bool { |
| 72 | return false |
| 73 | } |
| 74 | func (fi bindataFileInfo) Sys() interface{} { |
| 75 | return nil |
| 76 | } |
| 77 | |
| 78 | var _bindataTengoOutmessagetengo = []byte( |
| 79 | "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xc4\x91\x3d\x8f\xda\x40\x10\x86\xfb\xfd\x15\x13\x37\xb1\x2d\x07\xe7\xa3" + |
| 80 | "\xb3\x64\x59\x11\x45\x94\x2e\x8a\x92\x0a\xd0\xb1\xac\x07\x33\xd2\x7a\xc7\x1a\x8f\x31\x88\xe3\xbf\x9f\xcc\x01\x47" + |
| 81 | "\x7f\xc5\x75\xef\xae\x9e\x9d\x77\x1f\x4d\x9e\x9a\xbd\x15\xb2\x1b\x8f\x3d\xd8\xbd\x25\x3f\x45\x30\x82\xb6\xfe\xc2" + |
| 82 | "\xc1\x1f\x0b\x43\xe1\xa7\x73\x3c\x04\xcd\x80\xc2\x1f\x61\x65\xc7\x7e\xca\xf3\x9d\x0d\x01\x2f\xf1\x97\x55\x1c\xed" + |
| 83 | "\xd1\xf0\xa0\x77\x98\x07\x7d\xa3\x79\xd0\x3b\xce\x83\xde\xf8\xd7\x9e\x51\x48\xb1\x30\x6d\xdf\xfc\xc3\x83\x66\xd0" + |
| 84 | "\xf6\xcd\xff\x1e\x25\xd8\x16\x4d\x9a\x1b\xa3\x78\x50\x28\x4a\xa0\xb6\x63\xd1\x38\x9a\xce\x51\x62\x4c\x9e\x43\xaf" + |
| 85 | "\x42\x1d\x90\x38\x70\xec\x59\xfa\xe9\x8e\xb6\x30\xe2\x67\x41\x08\xac\xd0\x63\xa8\x29\x34\xa0\x0c\x36\x5c\xc0\x8d" + |
| 86 | "\x50\xdd\x20\x8c\x78\x7d\xac\x3b\x84\xdf\x7f\xe7\xb7\x01\xb4\x7d\xd0\x84\xb2\x84\x88\xc4\x45\x70\x32\x00\x00\x82" + |
| 87 | "\xd3\x3f\xa6\xfe\x99\xe0\x93\xe3\xb6\x23\x8f\xf1\x7a\x79\xf8\xfa\x23\xae\x8a\x65\x7d\xfa\x96\x7d\x3f\xc7\x55\x91" + |
| 88 | "\x5d\x63\x52\x25\xd5\xf3\x62\x51\xb8\xa0\xe2\x8b\xd5\x6a\x9d\x5c\xc6\x5c\x4d\x4b\xc1\x99\x60\xe7\xad\xc3\xf8\x26" + |
| 89 | "\x1f\x45\x89\x39\x9b\xf7\x6b\xe4\x29\x6d\x1f\x57\x00\x9f\x3e\xc6\x24\xcd\xcd\x4b\x00\x00\x00\xff\xff\x40\xb8\x54" + |
| 90 | "\xb8\x64\x02\x00\x00") |
| 91 | |
| 92 | func bindataTengoOutmessagetengoBytes() ([]byte, error) { |
| 93 | return bindataRead( |
| 94 | _bindataTengoOutmessagetengo, |
| 95 | "tengo/outmessage.tengo", |
| 96 | ) |
| 97 | } |
| 98 | |
| 99 | func bindataTengoOutmessagetengo() (*asset, error) { |
| 100 | bytes, err := bindataTengoOutmessagetengoBytes() |
| 101 | if err != nil { |
| 102 | return nil, err |
| 103 | } |
| 104 | |
| 105 | info := bindataFileInfo{ |
| 106 | name: "tengo/outmessage.tengo", |
| 107 | size: 612, |
| 108 | md5checksum: "", |
| 109 | mode: os.FileMode(420), |
| 110 | modTime: time.Unix(1555622139, 0), |
| 111 | } |
| 112 | |
| 113 | a := &asset{bytes: bytes, info: info} |
| 114 | |
| 115 | return a, nil |
| 116 | } |
| 117 | |
| 118 | // Asset loads and returns the asset for the given name. |
| 119 | // It returns an error if the asset could not be found or |
| 120 | // could not be loaded. |
| 121 | func Asset(name string) ([]byte, error) { |
| 122 | cannonicalName := strings.Replace(name, "\\", "/", -1) |
| 123 | if f, ok := _bindata[cannonicalName]; ok { |
| 124 | a, err := f() |
| 125 | if err != nil { |
| 126 | return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err) |
| 127 | } |
| 128 | return a.bytes, nil |
| 129 | } |
| 130 | return nil, &os.PathError{Op: "open", Path: name, Err: os.ErrNotExist} |
| 131 | } |
| 132 | |
| 133 | // MustAsset is like Asset but panics when Asset would return an error. |
| 134 | // It simplifies safe initialization of global variables. |
| 135 | // nolint: deadcode |
| 136 | func MustAsset(name string) []byte { |
| 137 | a, err := Asset(name) |
| 138 | if err != nil { |
| 139 | panic("asset: Asset(" + name + "): " + err.Error()) |
| 140 | } |
| 141 | |
| 142 | return a |
| 143 | } |
| 144 | |
| 145 | // AssetInfo loads and returns the asset info for the given name. |
| 146 | // It returns an error if the asset could not be found or could not be loaded. |
| 147 | func AssetInfo(name string) (os.FileInfo, error) { |
| 148 | cannonicalName := strings.Replace(name, "\\", "/", -1) |
| 149 | if f, ok := _bindata[cannonicalName]; ok { |
| 150 | a, err := f() |
| 151 | if err != nil { |
| 152 | return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err) |
| 153 | } |
| 154 | return a.info, nil |
| 155 | } |
| 156 | return nil, &os.PathError{Op: "open", Path: name, Err: os.ErrNotExist} |
| 157 | } |
| 158 | |
| 159 | // AssetNames returns the names of the assets. |
| 160 | // nolint: deadcode |
| 161 | func AssetNames() []string { |
| 162 | names := make([]string, 0, len(_bindata)) |
| 163 | for name := range _bindata { |
| 164 | names = append(names, name) |
| 165 | } |
| 166 | return names |
| 167 | } |
| 168 | |
| 169 | // _bindata is a table, holding each asset generator, mapped to its name. |
| 170 | var _bindata = map[string]func() (*asset, error){ |
| 171 | "tengo/outmessage.tengo": bindataTengoOutmessagetengo, |
| 172 | } |
| 173 | |
| 174 | // AssetDir returns the file names below a certain |
| 175 | // directory embedded in the file by go-bindata. |
| 176 | // For example if you run go-bindata on data/... and data contains the |
| 177 | // following hierarchy: |
| 178 | // |
| 179 | // data/ |
| 180 | // foo.txt |
| 181 | // img/ |
| 182 | // a.png |
| 183 | // b.png |
| 184 | // |
| 185 | // then AssetDir("data") would return []string{"foo.txt", "img"} |
| 186 | // AssetDir("data/img") would return []string{"a.png", "b.png"} |
| 187 | // AssetDir("foo.txt") and AssetDir("notexist") would return an error |
| 188 | // AssetDir("") will return []string{"data"}. |
| 189 | func AssetDir(name string) ([]string, error) { |
| 190 | node := _bintree |
| 191 | if len(name) != 0 { |
| 192 | cannonicalName := strings.Replace(name, "\\", "/", -1) |
| 193 | pathList := strings.Split(cannonicalName, "/") |
| 194 | for _, p := range pathList { |
| 195 | node = node.Children[p] |
| 196 | if node == nil { |
| 197 | return nil, &os.PathError{ |
| 198 | Op: "open", |
| 199 | Path: name, |
| 200 | Err: os.ErrNotExist, |
| 201 | } |
| 202 | } |
| 203 | } |
| 204 | } |
| 205 | if node.Func != nil { |
| 206 | return nil, &os.PathError{ |
| 207 | Op: "open", |
| 208 | Path: name, |
| 209 | Err: os.ErrNotExist, |
| 210 | } |
| 211 | } |
| 212 | rv := make([]string, 0, len(node.Children)) |
| 213 | for childName := range node.Children { |
| 214 | rv = append(rv, childName) |
| 215 | } |
| 216 | return rv, nil |
| 217 | } |
| 218 | |
| 219 | type bintree struct { |
| 220 | Func func() (*asset, error) |
| 221 | Children map[string]*bintree |
| 222 | } |
| 223 | |
| 224 | var _bintree = &bintree{Func: nil, Children: map[string]*bintree{ |
| 225 | "tengo": {Func: nil, Children: map[string]*bintree{ |
| 226 | "outmessage.tengo": {Func: bindataTengoOutmessagetengo, Children: map[string]*bintree{}}, |
| 227 | }}, |
| 228 | }} |
| 229 | |
| 230 | // RestoreAsset restores an asset under the given directory |
| 231 | func RestoreAsset(dir, name string) error { |
| 232 | data, err := Asset(name) |
| 233 | if err != nil { |
| 234 | return err |
| 235 | } |
| 236 | info, err := AssetInfo(name) |
| 237 | if err != nil { |
| 238 | return err |
| 239 | } |
| 240 | err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755)) |
| 241 | if err != nil { |
| 242 | return err |
| 243 | } |
| 244 | err = os.WriteFile(_filePath(dir, name), data, info.Mode()) |
| 245 | if err != nil { |
| 246 | return err |
| 247 | } |
| 248 | return os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime()) |
| 249 | } |
| 250 | |
| 251 | // RestoreAssets restores an asset under the given directory recursively |
| 252 | func RestoreAssets(dir, name string) error { |
| 253 | children, err := AssetDir(name) |
| 254 | // File |
| 255 | if err != nil { |
| 256 | return RestoreAsset(dir, name) |
| 257 | } |
| 258 | // Dir |
| 259 | for _, child := range children { |
| 260 | err = RestoreAssets(dir, filepath.Join(name, child)) |
| 261 | if err != nil { |
| 262 | return err |
| 263 | } |
| 264 | } |
| 265 | return nil |
| 266 | } |
| 267 | |
| 268 | func _filePath(dir, name string) string { |
| 269 | cannonicalName := strings.Replace(name, "\\", "/", -1) |
| 270 | return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...) |
| 271 | } |
| 272 | |