1
0
mirror of https://github.com/volatiletech/authboss.git synced 2024-12-10 10:40:07 +02:00
authboss/internal/response/bindata.go
2015-04-10 12:04:26 -07:00

379 lines
17 KiB
Go

package response
import (
"bytes"
"compress/gzip"
"fmt"
"io"
"strings"
"os"
"time"
"io/ioutil"
"path"
"path/filepath"
)
func bindata_read(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)
gz.Close()
if err != nil {
return nil, fmt.Errorf("Read %q: %v", name, err)
}
return buf.Bytes(), nil
}
type asset struct {
bytes []byte
info os.FileInfo
}
type bindata_file_info struct {
name string
size int64
mode os.FileMode
modTime time.Time
}
func (fi bindata_file_info) Name() string {
return fi.name
}
func (fi bindata_file_info) Size() int64 {
return fi.size
}
func (fi bindata_file_info) Mode() os.FileMode {
return fi.mode
}
func (fi bindata_file_info) ModTime() time.Time {
return fi.modTime
}
func (fi bindata_file_info) IsDir() bool {
return false
}
func (fi bindata_file_info) Sys() interface{} {
return nil
}
var _confirm_email_html_tpl = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xb2\xc9\x30\xb4\x73\xce\xcf\x4b\xcb\x2c\xca\x55\xa8\xcc\x2f\x2d\x52\x48\x4c\x4e\xce\x2f\xcd\x2b\xb1\xd1\x07\x4a\x70\xd9\x24\x15\x29\xe8\x03\xa9\x02\xbb\x80\x9c\xd4\xc4\xe2\x54\x85\xe4\x9c\xcc\xe4\x6c\x05\x9b\x44\x85\x8c\xa2\xd4\x34\x5b\xa5\xea\x6a\xbd\xda\x5a\x25\xa0\x92\x8c\xd4\xa2\x54\x1b\xfd\x44\x3b\x85\x92\x7c\x85\x64\xac\xc6\x15\xd8\x71\x01\x02\x00\x00\xff\xff\xd9\xba\x4f\x59\x6c\x00\x00\x00")
func confirm_email_html_tpl_bytes() ([]byte, error) {
return bindata_read(
_confirm_email_html_tpl,
"confirm_email.html.tpl",
)
}
func confirm_email_html_tpl() (*asset, error) {
bytes, err := confirm_email_html_tpl_bytes()
if err != nil {
return nil, err
}
info := bindata_file_info{name: "confirm_email.html.tpl", size: 108, mode: os.FileMode(438), modTime: time.Unix(1425861488, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
var _confirm_email_txt_tpl = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x24\xc8\xd1\x0d\x82\x40\x10\x04\xd0\x56\xa6\x02\x6b\xb1\x00\x7e\xce\x73\xd1\x8d\xeb\x0c\xd9\x5b\x42\x08\xa1\x77\x4d\xf8\x7c\xef\x1e\xd6\x86\xa1\x6b\xd9\xd1\xf8\xc4\xd2\x46\x19\xea\x6d\x98\x15\xa1\xcd\xf9\x42\x38\x3f\x70\x96\xb0\x6b\x4d\x3c\x52\xdb\xb0\xc4\xdf\x5d\x9c\x3d\xbf\xd7\xb7\xde\xb5\xb2\x26\x4e\x3c\x8e\xdb\x79\xfe\x02\x00\x00\xff\xff\x66\x27\xac\x6d\x5b\x00\x00\x00")
func confirm_email_txt_tpl_bytes() ([]byte, error) {
return bindata_read(
_confirm_email_txt_tpl,
"confirm_email.txt.tpl",
)
}
func confirm_email_txt_tpl() (*asset, error) {
bytes, err := confirm_email_txt_tpl_bytes()
if err != nil {
return nil, err
}
info := bindata_file_info{name: "confirm_email.txt.tpl", size: 91, mode: os.FileMode(438), modTime: time.Unix(1425861619, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
var _login_html_tpl = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x7c\x92\xcb\x6e\xeb\x20\x10\x86\xf7\x91\xf2\x0e\x88\xfd\x89\x5f\xc0\xb6\x74\xa4\xb3\x39\x52\x2f\x51\x1b\x75\x5b\x61\x3c\x0e\x28\x06\xac\x61\x9c\x8b\x90\xdf\xbd\xa6\x76\x5a\xd3\x46\xf1\xca\x0c\x3f\x1f\x1f\x30\x21\x6c\x9a\x56\x78\xf5\xee\x7b\x29\xc1\xfb\x61\x58\xaf\xf2\xc6\xa1\x61\x42\x92\x76\xb6\xe0\x21\x18\xd7\x5b\xea\x04\x29\xa8\x19\x6f\xdd\x5e\x5b\x3e\x0c\x9c\x19\x20\xe5\xea\x82\x6f\x9f\x5f\x77\xbc\x5c\xaf\xd8\xf8\x85\xa0\x1b\xb6\x01\x44\x87\xc3\x30\xb2\xe7\xbf\xbc\x42\x96\x95\x21\x80\xad\xe3\x06\x31\x99\x6b\xdb\xf5\xc4\xe8\xd2\x41\xc1\x09\xce\xc4\x99\x1c\x45\x7c\xc1\xe3\xee\x7f\xa4\xb3\x84\xae\xe5\xcc\x0a\x03\x51\x62\xd3\xa1\x36\x02\x2f\xff\xff\xc5\xbd\xbb\x56\x48\x50\xae\xad\x01\xe3\x24\x69\x6a\x81\xa5\x91\xa3\x68\xfb\x1f\x2b\xdf\x62\x69\x9c\x2b\x27\x9f\x44\x64\x36\xe9\x46\x85\x93\xc3\xfa\xae\xcd\x77\x28\xf1\xd8\x5e\xcb\xb7\xf8\x13\x5e\xe9\xba\x06\xbb\x38\xd5\xd9\x63\xf3\x34\x0e\x52\xe3\x58\xdd\xb9\x03\xd8\x58\xce\x92\xbb\xf5\xca\x9d\x5e\xc0\x80\xa9\x20\x5e\xec\x12\x2e\x15\xc8\x43\xe5\xce\x57\x3c\x9a\x2f\x26\x61\x0f\xbc\x64\xd7\x85\xec\x11\xd2\xc7\xa8\x7a\x22\x67\x67\x8e\xef\x2b\xa3\x89\x97\x0f\xf1\xa9\xf3\x6c\x9a\x4b\xce\xb4\x54\x91\xee\xf8\x69\x22\x98\x42\x68\x7e\xf5\x0b\x4e\x81\xd8\x31\xe5\x1c\x66\x7f\xa5\x8c\x91\x3c\x13\x69\x4f\x2c\xb1\x7b\xed\xe9\x3e\x77\x4a\xcc\xe0\x69\x70\x93\x9c\x67\xf1\x0d\xcb\x8f\x00\x00\x00\xff\xff\x66\x78\xba\x32\xea\x02\x00\x00")
func login_html_tpl_bytes() ([]byte, error) {
return bindata_read(
_login_html_tpl,
"login.html.tpl",
)
}
func login_html_tpl() (*asset, error) {
bytes, err := login_html_tpl_bytes()
if err != nil {
return nil, err
}
info := bindata_file_info{name: "login.html.tpl", size: 746, mode: os.FileMode(438), modTime: time.Unix(1428692472, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
var _recover_html_tpl = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xb4\x52\x4d\x6f\xe2\x30\x10\xbd\xf3\x2b\x46\x16\x7b\x25\xf7\x95\x93\x0b\x7b\xd9\x4b\x8b\x5a\xd4\x6b\x65\x92\x09\xb1\x6a\x8f\x2d\x67\x42\x41\x6e\xfe\x7b\x6d\x82\x10\xb4\x12\xa8\x87\xe6\x90\xcc\xc7\x7b\x6f\x32\x4f\x23\x5b\x17\x2c\xa8\x9a\xb5\xa3\x52\xc4\x68\xdd\x40\xec\x15\x77\xd8\x80\x08\x58\xbb\x1d\x06\x31\x8e\x02\x2c\x72\xe7\x9a\x52\xac\x1e\x9f\xd7\xa2\x9a\x41\x7a\xa4\x26\x3f\x30\xf0\xc1\x63\x29\x18\xf7\x2c\x80\x94\xc5\x2c\xb3\xf0\x41\x5b\x15\x0e\xff\xff\x65\xae\x37\xaa\xc6\xce\x99\x06\x43\x6e\xb2\x66\x83\x70\x0d\xd9\x29\x33\x7c\x61\xbe\xe4\x52\xee\x15\x95\xdc\x84\xf4\x3e\x0e\x8d\x71\xee\x75\x03\x7f\xcb\x2b\x81\x18\xdf\x35\x77\xb0\xc0\x10\xfa\x73\x36\x4f\x99\xd1\x3d\x67\xb0\xa6\x06\xf7\xb0\x80\x4c\xce\x80\xa0\x68\x8b\x67\xc4\x38\xca\xde\x2b\xaa\xd2\xf8\x14\x16\xc7\x78\x9a\x19\x23\xd2\x91\x70\xf9\xb9\xbd\x7d\xed\xa8\xd5\xc1\xbe\xde\x74\x61\x39\x81\xe0\x9e\x1b\x27\xb1\xd5\x5d\x53\xea\x6f\xae\xc0\x07\xa4\x98\xb8\x85\xf3\x2f\xfd\xe9\xc5\x4f\xbc\xaa\x7f\xc7\xac\x4e\x37\x0d\xd2\xc5\xb1\xec\xfb\xd0\x3e\xa4\xe4\x7a\xf5\x5c\x5d\xbb\x37\xa4\x69\xdd\x49\x67\x33\x30\x3b\x3a\x09\xf5\xc3\xc6\x6a\x16\xd5\xd3\x74\xa7\xb2\x98\xba\x97\xce\x48\x05\x5d\xc0\xb6\x14\x85\x71\x5b\x4d\xa2\x5a\x2a\xaa\xd1\xc8\x42\x55\x33\x59\xe4\xe3\xaf\x3e\x03\x00\x00\xff\xff\xa8\x01\x1f\xc8\x03\x03\x00\x00")
func recover_html_tpl_bytes() ([]byte, error) {
return bindata_read(
_recover_html_tpl,
"recover.html.tpl",
)
}
func recover_html_tpl() (*asset, error) {
bytes, err := recover_html_tpl_bytes()
if err != nil {
return nil, err
}
info := bindata_file_info{name: "recover.html.tpl", size: 771, mode: os.FileMode(438), modTime: time.Unix(1425014937, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
var _recover_complete_html_tpl = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xb4\x52\xc1\x6e\xeb\x20\x10\xbc\xe7\x2b\x10\x7a\xe7\x70\x7f\xc2\xbe\xe4\xde\x46\x6d\xee\x15\x31\xeb\x18\x15\x16\x04\xeb\x24\x95\xe5\x7f\x2f\xc4\x49\x9c\xb6\xa9\x7a\xa8\xea\x8b\x99\x65\x67\x86\x91\x46\xb6\x3e\x3a\xa6\x1a\x32\x1e\x2b\x3e\x0c\xce\xf7\x48\x41\x51\x07\x9a\xf1\x08\x8d\xdf\x43\x14\x8d\x77\xc1\x02\x01\x1f\x47\xce\x1c\x50\xe7\x75\xc5\xd7\x8f\xcf\x1b\x5e\x2f\x58\xfe\xa4\xc1\xd0\x13\xa3\xb7\x00\x15\xef\x8c\xd6\x80\x9c\xa1\x72\x19\x91\x7f\x2d\x60\xaf\x6c\x0f\x45\x7f\x79\x1a\x14\x1d\x71\x87\x1b\x54\x4a\x07\x1f\xf5\x85\x3d\xe3\x60\x55\x03\x9d\xb7\x1a\x62\xb6\xbe\x8e\x67\xdd\xcb\xea\x24\x2d\xb7\xf1\x62\x30\x0c\x07\x43\x1d\x5b\x42\x8c\x69\x1c\xcf\xe8\x5f\x46\xd6\x24\x62\xff\x2b\x66\x50\xc3\x91\x2d\xd9\xec\x56\xd6\xa2\xc2\x1d\x5c\xf7\xc6\x51\xa6\xa0\xb0\xce\x46\xf9\x28\x4e\xe7\xc9\x63\x18\x00\x75\x21\xdc\xfe\x7e\x4e\xd6\x78\x6c\x4d\x74\x2f\xdf\x24\x5c\x4d\xd7\xec\x5e\xd2\x33\x75\xfd\xfb\xc0\x5f\x1e\xf1\x07\xc1\x3f\xd6\x21\xcb\x1c\x53\x6c\x1f\x32\x28\xef\x9e\x43\x95\xe9\xe6\x73\x35\xb6\x3d\x91\xc7\xb3\x50\xea\xb7\xce\x10\xaf\x9f\xa6\x52\x4a\x31\xdd\xde\x26\x97\x8a\x75\x11\xda\x8a\x0b\xeb\x77\x06\x79\xbd\x52\xd8\x80\x95\x42\xd5\x0b\x29\x4a\xd3\xeb\xf7\x00\x00\x00\xff\xff\xba\x89\x7e\x9e\xf0\x02\x00\x00")
func recover_complete_html_tpl_bytes() ([]byte, error) {
return bindata_read(
_recover_complete_html_tpl,
"recover_complete.html.tpl",
)
}
func recover_complete_html_tpl() (*asset, error) {
bytes, err := recover_complete_html_tpl_bytes()
if err != nil {
return nil, err
}
info := bindata_file_info{name: "recover_complete.html.tpl", size: 752, mode: os.FileMode(438), modTime: time.Unix(1425060725, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
var _recover_email_html_tpl = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xb2\xc9\x30\xb4\x0b\x4a\x4d\xce\x2f\x4b\x2d\x52\xa8\xcc\x2f\x2d\x52\x48\x4c\x4e\xce\x2f\xcd\x2b\xb1\xd1\x07\x4a\x70\xd9\x24\x15\x29\xe8\x03\xa9\x02\xbb\x80\x9c\xd4\xc4\xe2\x54\x85\xe4\x9c\xcc\xe4\x6c\x05\x9b\x44\x85\x8c\xa2\xd4\x34\x5b\xa5\xea\x6a\xbd\xda\x5a\x25\xa0\x92\x8c\xd4\xa2\x54\x1b\xfd\x44\x3b\x85\x92\x7c\x85\x22\xac\xc6\x15\xd8\x71\x01\x02\x00\x00\xff\xff\x9d\xc9\x73\xb1\x6c\x00\x00\x00")
func recover_email_html_tpl_bytes() ([]byte, error) {
return bindata_read(
_recover_email_html_tpl,
"recover_email.html.tpl",
)
}
func recover_email_html_tpl() (*asset, error) {
bytes, err := recover_email_html_tpl_bytes()
if err != nil {
return nil, err
}
info := bindata_file_info{name: "recover_email.html.tpl", size: 108, mode: os.FileMode(438), modTime: time.Unix(1425861503, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
var _recover_email_txt_tpl = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x24\xc8\xd1\x0d\x82\x40\x10\x04\xd0\x56\xa6\x02\x6b\xb1\x00\x7e\xce\x73\xd1\x8d\xeb\x0c\xd9\x5b\x42\x08\xa1\x77\x4d\xf8\x7c\xef\x1e\xd6\x86\xa1\x6b\xd9\xd1\xf8\xc4\xd2\x46\x19\xea\x6d\x98\x15\xa1\xcd\xf9\x42\x38\x3f\x70\x96\xb0\x6b\x4d\x3c\x52\xdb\xb0\xc4\xdf\x5d\x9c\x3d\xbf\xd7\xb7\xde\xb5\xb2\x26\x4e\x3c\x8e\xdb\x79\xfe\x02\x00\x00\xff\xff\x66\x27\xac\x6d\x5b\x00\x00\x00")
func recover_email_txt_tpl_bytes() ([]byte, error) {
return bindata_read(
_recover_email_txt_tpl,
"recover_email.txt.tpl",
)
}
func recover_email_txt_tpl() (*asset, error) {
bytes, err := recover_email_txt_tpl_bytes()
if err != nil {
return nil, err
}
info := bindata_file_info{name: "recover_email.txt.tpl", size: 91, mode: os.FileMode(438), modTime: time.Unix(1425861617, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
var _register_html_tpl = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x94\x53\x4d\x6f\xe2\x30\x10\x3d\x93\x5f\x31\xb2\x38\x93\x3b\x72\x72\xd9\xbd\xec\x65\x85\x56\xab\x5e\x2b\x13\x4f\x88\x55\x7f\xc9\x76\x0a\x28\xca\x7f\xaf\x9d\x40\x42\x40\x6d\xe9\xc5\xf6\x8c\xde\x9b\x79\x6f\x34\xa6\xb5\x71\x0a\x58\x15\x84\xd1\x05\xe9\x3a\x65\x5a\x1d\x2c\x0b\x0d\x72\x20\x0e\x0f\xc2\x07\x74\xa4\xef\x09\x28\x0c\x8d\xe1\x05\xb1\xc6\x07\x52\x66\x2b\x2a\xd9\x1e\x25\x44\x7e\xe2\x6d\xac\x13\x8a\xb9\xf3\x9f\xdf\x11\x5b\x76\x5d\x10\x41\x22\xdc\x66\xb7\x34\x1f\x18\x89\x2a\xb4\x6d\x03\x68\xa6\xf0\x81\x0b\xe1\x6c\x63\x36\xe0\x29\x10\x78\x67\xb2\x1d\x20\x47\x11\x9a\x9b\x6a\x2f\x29\xdf\xf7\x91\x9a\x0e\xd4\x3c\x11\xad\x64\x15\x36\x46\x72\x1c\x14\x3d\x2a\x20\x90\x97\x74\xef\xe2\x99\xad\xba\x6e\x6d\x05\x87\x6d\xb1\x40\x5c\x1b\xa1\x73\x7e\x8a\xd6\x31\x92\x71\x0e\x09\x2c\x34\xc7\x13\x6c\x20\x91\x13\xc0\x31\x7d\xc0\x09\xd1\xf7\xd4\x5b\xa6\xcb\x41\x17\xcd\x87\xf7\xd8\xf0\x22\x72\x79\x2d\x67\x68\x99\xf7\x47\xe3\x38\x29\x77\x97\xd7\x67\x13\x9b\x90\x97\x59\xcd\xf1\x62\x04\xbb\x29\x7d\x6b\x7b\x69\x70\xd4\xbf\xb9\x56\x78\xd6\xc0\x52\x79\x65\x74\x2d\x9c\x7a\x9d\x1d\xfc\x1a\x33\xf0\x9d\x93\x07\xe6\xd7\x8e\xee\xcb\x3e\xe1\xec\xbe\xc3\x0f\x1c\x8e\x42\x47\x41\xbe\xdd\x2b\x31\x2f\xe4\xbf\xeb\xc7\x98\xda\x53\x06\x8d\xc3\xba\x20\x79\x74\xcf\x74\x85\x92\xe6\xac\xcc\xee\xca\x34\x82\x73\xd4\x64\xde\xfc\x93\x77\xf5\xdf\x18\xa4\xe5\x9c\x96\x7d\xc8\xfe\x37\x6f\xa8\xc7\x9d\xcd\x68\x9e\x7e\x69\xf9\x11\x00\x00\xff\xff\x0e\xa6\x2d\x81\xac\x03\x00\x00")
func register_html_tpl_bytes() ([]byte, error) {
return bindata_read(
_register_html_tpl,
"register.html.tpl",
)
}
func register_html_tpl() (*asset, error) {
bytes, err := register_html_tpl_bytes()
if err != nil {
return nil, err
}
info := bindata_file_info{name: "register.html.tpl", size: 940, mode: os.FileMode(438), modTime: time.Unix(1424982621, 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)
}
// 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){
"confirm_email.html.tpl": confirm_email_html_tpl,
"confirm_email.txt.tpl": confirm_email_txt_tpl,
"login.html.tpl": login_html_tpl,
"recover.html.tpl": recover_html_tpl,
"recover_complete.html.tpl": recover_complete_html_tpl,
"recover_email.html.tpl": recover_email_html_tpl,
"recover_email.txt.tpl": recover_email_txt_tpl,
"register.html.tpl": register_html_tpl,
}
// 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 name := range node.Children {
rv = append(rv, name)
}
return rv, nil
}
type _bintree_t struct {
Func func() (*asset, error)
Children map[string]*_bintree_t
}
var _bintree = &_bintree_t{nil, map[string]*_bintree_t{
"confirm_email.html.tpl": &_bintree_t{confirm_email_html_tpl, map[string]*_bintree_t{
}},
"confirm_email.txt.tpl": &_bintree_t{confirm_email_txt_tpl, map[string]*_bintree_t{
}},
"login.html.tpl": &_bintree_t{login_html_tpl, map[string]*_bintree_t{
}},
"recover.html.tpl": &_bintree_t{recover_html_tpl, map[string]*_bintree_t{
}},
"recover_complete.html.tpl": &_bintree_t{recover_complete_html_tpl, map[string]*_bintree_t{
}},
"recover_email.html.tpl": &_bintree_t{recover_email_html_tpl, map[string]*_bintree_t{
}},
"recover_email.txt.tpl": &_bintree_t{recover_email_txt_tpl, map[string]*_bintree_t{
}},
"register.html.tpl": &_bintree_t{register_html_tpl, map[string]*_bintree_t{
}},
}}
// Restore 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, path.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
}
// Restore assets under the given directory recursively
func RestoreAssets(dir, name string) error {
children, err := AssetDir(name)
if err != nil { // File
return RestoreAsset(dir, name)
} else { // Dir
for _, child := range children {
err = RestoreAssets(dir, path.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, "/")...)...)
}