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