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