1// Code generated by go-bindata. DO NOT EDIT.
2// sources:
3// tengo/outmessage.tengo
4
5package internal
6
7
8import (
9	"bytes"
10	"compress/gzip"
11	"fmt"
12	"io"
13	"io/ioutil"
14	"os"
15	"path/filepath"
16	"strings"
17	"time"
18)
19
20func 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
41type asset struct {
42	bytes []byte
43	info  fileInfoEx
44}
45
46type fileInfoEx interface {
47	os.FileInfo
48	MD5Checksum() string
49}
50
51type bindataFileInfo struct {
52	name        string
53	size        int64
54	mode        os.FileMode
55	modTime     time.Time
56	md5checksum string
57}
58
59func (fi bindataFileInfo) Name() string {
60	return fi.name
61}
62func (fi bindataFileInfo) Size() int64 {
63	return fi.size
64}
65func (fi bindataFileInfo) Mode() os.FileMode {
66	return fi.mode
67}
68func (fi bindataFileInfo) ModTime() time.Time {
69	return fi.modTime
70}
71func (fi bindataFileInfo) MD5Checksum() string {
72	return fi.md5checksum
73}
74func (fi bindataFileInfo) IsDir() bool {
75	return false
76}
77func (fi bindataFileInfo) Sys() interface{} {
78	return nil
79}
80
81var _bindataTengoOutmessagetengo = []byte(
82	"\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" +
83	"\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" +
84	"\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" +
85	"\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" +
86	"\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" +
87	"\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" +
88	"\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" +
89	"\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" +
90	"\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" +
91	"\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" +
92	"\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" +
93	"\xb8\x64\x02\x00\x00")
94
95func bindataTengoOutmessagetengoBytes() ([]byte, error) {
96	return bindataRead(
97		_bindataTengoOutmessagetengo,
98		"tengo/outmessage.tengo",
99	)
100}
101
102
103
104func bindataTengoOutmessagetengo() (*asset, error) {
105	bytes, err := bindataTengoOutmessagetengoBytes()
106	if err != nil {
107		return nil, err
108	}
109
110	info := bindataFileInfo{
111		name: "tengo/outmessage.tengo",
112		size: 612,
113		md5checksum: "",
114		mode: os.FileMode(420),
115		modTime: time.Unix(1555622139, 0),
116	}
117
118	a := &asset{bytes: bytes, info: info}
119
120	return a, nil
121}
122
123
124//
125// Asset loads and returns the asset for the given name.
126// It returns an error if the asset could not be found or
127// could not be loaded.
128//
129func Asset(name string) ([]byte, error) {
130	cannonicalName := strings.Replace(name, "\\", "/", -1)
131	if f, ok := _bindata[cannonicalName]; ok {
132		a, err := f()
133		if err != nil {
134			return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err)
135		}
136		return a.bytes, nil
137	}
138	return nil, &os.PathError{Op: "open", Path: name, Err: os.ErrNotExist}
139}
140
141//
142// MustAsset is like Asset but panics when Asset would return an error.
143// It simplifies safe initialization of global variables.
144// nolint: deadcode
145//
146func MustAsset(name string) []byte {
147	a, err := Asset(name)
148	if err != nil {
149		panic("asset: Asset(" + name + "): " + err.Error())
150	}
151
152	return a
153}
154
155//
156// AssetInfo loads and returns the asset info for the given name.
157// It returns an error if the asset could not be found or could not be loaded.
158//
159func AssetInfo(name string) (os.FileInfo, error) {
160	cannonicalName := strings.Replace(name, "\\", "/", -1)
161	if f, ok := _bindata[cannonicalName]; ok {
162		a, err := f()
163		if err != nil {
164			return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err)
165		}
166		return a.info, nil
167	}
168	return nil, &os.PathError{Op: "open", Path: name, Err: os.ErrNotExist}
169}
170
171//
172// AssetNames returns the names of the assets.
173// nolint: deadcode
174//
175func AssetNames() []string {
176	names := make([]string, 0, len(_bindata))
177	for name := range _bindata {
178		names = append(names, name)
179	}
180	return names
181}
182
183//
184// _bindata is a table, holding each asset generator, mapped to its name.
185//
186var _bindata = map[string]func() (*asset, error){
187	"tengo/outmessage.tengo": bindataTengoOutmessagetengo,
188}
189
190//
191// AssetDir returns the file names below a certain
192// directory embedded in the file by go-bindata.
193// For example if you run go-bindata on data/... and data contains the
194// following hierarchy:
195//     data/
196//       foo.txt
197//       img/
198//         a.png
199//         b.png
200// then AssetDir("data") would return []string{"foo.txt", "img"}
201// AssetDir("data/img") would return []string{"a.png", "b.png"}
202// AssetDir("foo.txt") and AssetDir("notexist") would return an error
203// AssetDir("") will return []string{"data"}.
204//
205func AssetDir(name string) ([]string, error) {
206	node := _bintree
207	if len(name) != 0 {
208		cannonicalName := strings.Replace(name, "\\", "/", -1)
209		pathList := strings.Split(cannonicalName, "/")
210		for _, p := range pathList {
211			node = node.Children[p]
212			if node == nil {
213				return nil, &os.PathError{
214					Op: "open",
215					Path: name,
216					Err: os.ErrNotExist,
217				}
218			}
219		}
220	}
221	if node.Func != nil {
222		return nil, &os.PathError{
223			Op: "open",
224			Path: name,
225			Err: os.ErrNotExist,
226		}
227	}
228	rv := make([]string, 0, len(node.Children))
229	for childName := range node.Children {
230		rv = append(rv, childName)
231	}
232	return rv, nil
233}
234
235
236type bintree struct {
237	Func     func() (*asset, error)
238	Children map[string]*bintree
239}
240
241var _bintree = &bintree{Func: nil, Children: map[string]*bintree{
242	"tengo": {Func: nil, Children: map[string]*bintree{
243		"outmessage.tengo": {Func: bindataTengoOutmessagetengo, Children: map[string]*bintree{}},
244	}},
245}}
246
247// RestoreAsset restores an asset under the given directory
248func RestoreAsset(dir, name string) error {
249	data, err := Asset(name)
250	if err != nil {
251		return err
252	}
253	info, err := AssetInfo(name)
254	if err != nil {
255		return err
256	}
257	err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755))
258	if err != nil {
259		return err
260	}
261	err = ioutil.WriteFile(_filePath(dir, name), data, info.Mode())
262	if err != nil {
263		return err
264	}
265	return os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime())
266}
267
268// RestoreAssets restores an asset under the given directory recursively
269func RestoreAssets(dir, name string) error {
270	children, err := AssetDir(name)
271	// File
272	if err != nil {
273		return RestoreAsset(dir, name)
274	}
275	// Dir
276	for _, child := range children {
277		err = RestoreAssets(dir, filepath.Join(name, child))
278		if err != nil {
279			return err
280		}
281	}
282	return nil
283}
284
285func _filePath(dir, name string) string {
286	cannonicalName := strings.Replace(name, "\\", "/", -1)
287	return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...)
288}
289