alertmanager/template/internal/deftmpl/bindata.go

238 lines
16 KiB
Go

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