go-waku/waku/persistence/sqlite/migrations/bindata.go

464 lines
18 KiB
Go

// Code generated by go-bindata. DO NOT EDIT.
// sources:
// 1_messages.down.sql (124B)
// 1_messages.up.sql (464B)
// 2_messages_index.down.sql (60B)
// 2_messages_index.up.sql (226B)
// 3_rendezvous.down.sql (65B)
// 3_rendezvous.up.sql (204B)
// 4_signed_peer_record.down.sql (186B)
// 4_signed_peer_record.up.sql (197B)
// doc.go (74B)
package migrations
import (
"bytes"
"compress/gzip"
"crypto/sha256"
"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
digest [sha256.Size]byte
}
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 __1_messagesDownSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x72\x09\xf2\x0f\x50\xf0\xf4\x73\x71\x8d\x50\xf0\x74\x53\x70\x8d\xf0\x0c\x0e\x09\x56\xc8\x4d\x2d\x2e\x4e\x4c\x4f\x8d\x2f\x4e\xcd\x4b\x49\x2d\x0a\xc9\xcc\x4d\x2d\x2e\x49\xcc\x2d\xb0\xe6\xc2\xab\xba\x28\x35\x39\x35\xb3\x0c\x53\x7d\x88\xa3\x93\x8f\x2b\xa6\x7a\x6b\x2e\x40\x00\x00\x00\xff\xff\xc2\x48\x8c\x05\x7c\x00\x00\x00")
func _1_messagesDownSqlBytes() ([]byte, error) {
return bindataRead(
__1_messagesDownSql,
"1_messages.down.sql",
)
}
func _1_messagesDownSql() (*asset, error) {
bytes, err := _1_messagesDownSqlBytes()
if err != nil {
return nil, err
}
info := bindataFileInfo{name: "1_messages.down.sql", size: 124, mode: os.FileMode(0664), modTime: time.Unix(1673044753, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xff, 0x4a, 0x8e, 0xa9, 0xd9, 0xa8, 0xa4, 0x73, 0x3a, 0x54, 0xe4, 0x35, 0xfd, 0xea, 0x87, 0x4c, 0xa, 0x5c, 0xc0, 0xc9, 0xe7, 0x8, 0x8c, 0x6f, 0x60, 0x9e, 0x54, 0x77, 0x59, 0xd0, 0x2b, 0xfe}}
return a, nil
}
var __1_messagesUpSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x8c\x90\x41\x4f\x83\x40\x10\x85\xcf\xec\xaf\x98\x23\x24\x1c\xbc\x73\x82\xb2\xd5\x89\xeb\xae\x59\x86\xb4\x3d\x19\x0a\x13\xb3\x89\x2c\x84\xa5\x8d\xfe\x7b\x93\xc6\x1a\x52\x34\x7a\xfe\x76\xdf\x9b\xf7\x6d\xac\xcc\x49\x02\xe5\x85\x92\x80\x5b\xd0\x86\x40\xee\xb1\xa2\x0a\x7a\x0e\xa1\x79\x65\x88\x45\xe4\x3a\x28\x94\x29\x52\x11\x4d\xdc\xb2\x3b\xf3\x44\xae\xe7\x30\x37\xfd\x08\xa8\x49\xde\x4b\x7b\xf9\xa9\x6b\xa5\x52\x11\x05\xf6\xdd\x1f\x4f\xda\xc1\xcf\xec\x67\x1a\x46\xd7\x5e\xb2\x97\x70\x3c\x1d\xc3\xe9\xf8\x0b\x6b\x3e\xde\x86\xe6\xfb\x9e\x33\x4f\xc1\x0d\x7e\x55\x01\xa5\xdc\xe6\xb5\x22\xb8\x4b\x45\xb4\x31\xba\x22\x9b\xa3\xa6\xeb\x28\xf4\x1d\xbf\xc3\xb3\xc5\xa7\xdc\x1e\xe0\x51\x1e\x20\x76\x5d\x0a\x8b\xe2\x44\x24\xb0\x43\x7a\x30\x35\x81\x35\x3b\x2c\x33\x21\xbe\x64\xa1\x2e\xe5\xfe\x67\x59\x2f\xb7\xd3\x8d\xbe\xa2\xf8\x06\x25\xd9\x7f\xf2\xd6\xbe\x17\x89\x2b\x98\x64\x9f\x01\x00\x00\xff\xff\x59\xcd\x67\xb6\xd0\x01\x00\x00")
func _1_messagesUpSqlBytes() ([]byte, error) {
return bindataRead(
__1_messagesUpSql,
"1_messages.up.sql",
)
}
func _1_messagesUpSql() (*asset, error) {
bytes, err := _1_messagesUpSqlBytes()
if err != nil {
return nil, err
}
info := bindataFileInfo{name: "1_messages.up.sql", size: 464, mode: os.FileMode(0664), modTime: time.Unix(1673044753, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x4, 0xd8, 0x47, 0x7b, 0xe, 0x47, 0x2a, 0x4b, 0x48, 0x36, 0x23, 0x93, 0x28, 0xb3, 0x1e, 0x5, 0x76, 0x64, 0x73, 0xb, 0x2b, 0x5b, 0x10, 0x62, 0x36, 0x21, 0x6f, 0xa3, 0x3c, 0xdd, 0xe2, 0xcf}}
return a, nil
}
var __2_messages_indexDownSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x72\x09\xf2\x0f\x50\xf0\xf4\x73\x71\x8d\x50\xf0\x74\x53\x70\x8d\xf0\x0c\x0e\x09\x56\xc8\x8c\xcf\x2d\x4e\x8f\x37\xb4\xe6\xc2\x23\x6b\x64\xcd\x05\x08\x00\x00\xff\xff\x53\x77\x9e\x4d\x3c\x00\x00\x00")
func _2_messages_indexDownSqlBytes() ([]byte, error) {
return bindataRead(
__2_messages_indexDownSql,
"2_messages_index.down.sql",
)
}
func _2_messages_indexDownSql() (*asset, error) {
bytes, err := _2_messages_indexDownSqlBytes()
if err != nil {
return nil, err
}
info := bindataFileInfo{name: "2_messages_index.down.sql", size: 60, mode: os.FileMode(0664), modTime: time.Unix(1673044753, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x6e, 0xcb, 0x70, 0x82, 0x33, 0x13, 0x70, 0xd5, 0xbd, 0x3e, 0x68, 0x9, 0x4f, 0x78, 0xa9, 0xc, 0xd6, 0xf4, 0x64, 0xa0, 0x8c, 0xe4, 0x0, 0x15, 0x71, 0xf0, 0x5, 0xdb, 0xa6, 0xf2, 0x12, 0x60}}
return a, nil
}
var __2_messages_indexUpSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x72\x0e\x72\x75\x0c\x71\x55\xf0\xf4\x73\x71\x8d\x50\xf0\x74\x53\xf0\xf3\x0f\x51\x70\x8d\xf0\x0c\x0e\x09\x56\xc8\x8c\xcf\x2d\x4e\x8f\x37\x54\xf0\xf7\x53\xc8\x4d\x2d\x2e\x4e\x4c\x4f\xd5\x48\xce\xcf\x2b\x49\xcd\x2b\x09\xc9\x2f\xc8\x4c\x56\x70\x0c\x76\xd6\x51\x28\x28\x4d\x2a\x2e\x4d\x42\x12\x28\x4e\xcd\x4b\x49\x2d\x0a\xc9\xcc\x4d\x2d\x2e\x49\xcc\x2d\x80\x08\x66\xa6\x80\x68\x4d\x6b\x2e\x82\xd6\x19\xe1\xb4\xce\xc5\x15\xdd\x3e\x88\x08\xba\x85\x10\xd1\xcc\x14\x30\x43\xd3\x9a\x0b\x10\x00\x00\xff\xff\x2a\x3b\xab\xf4\xe2\x00\x00\x00")
func _2_messages_indexUpSqlBytes() ([]byte, error) {
return bindataRead(
__2_messages_indexUpSql,
"2_messages_index.up.sql",
)
}
func _2_messages_indexUpSql() (*asset, error) {
bytes, err := _2_messages_indexUpSqlBytes()
if err != nil {
return nil, err
}
info := bindataFileInfo{name: "2_messages_index.up.sql", size: 226, mode: os.FileMode(0664), modTime: time.Unix(1673044753, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xce, 0xb1, 0xc8, 0x2d, 0xa8, 0x6f, 0x83, 0xfb, 0xf2, 0x40, 0x30, 0xe9, 0xd, 0x18, 0x54, 0xe8, 0xf5, 0xf5, 0xc4, 0x5b, 0xf5, 0xa4, 0x94, 0x50, 0x56, 0x4a, 0xc8, 0x73, 0x3f, 0xf1, 0x56, 0xce}}
return a, nil
}
var __3_rendezvousDownSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x72\x09\xf2\x0f\x50\x08\x71\x74\xf2\x71\x55\xf0\x74\x53\x70\x8d\xf0\x0c\x0e\x09\x56\x08\x4a\x4d\xcf\x2c\x2e\x29\x4a\x2c\xc9\xcc\xcf\x2b\xb6\xe6\xe2\xc2\xaa\xc8\x2f\x3f\x2f\x39\xd5\x9a\x0b\x10\x00\x00\xff\xff\x58\x3f\x49\x49\x41\x00\x00\x00")
func _3_rendezvousDownSqlBytes() ([]byte, error) {
return bindataRead(
__3_rendezvousDownSql,
"3_rendezvous.down.sql",
)
}
func _3_rendezvousDownSql() (*asset, error) {
bytes, err := _3_rendezvousDownSqlBytes()
if err != nil {
return nil, err
}
info := bindataFileInfo{name: "3_rendezvous.down.sql", size: 65, mode: os.FileMode(0664), modTime: time.Unix(1678392960, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x1f, 0x4b, 0xc0, 0x7d, 0x4f, 0xac, 0xc4, 0x75, 0x59, 0xcc, 0xfc, 0x1a, 0x6c, 0x18, 0x81, 0x29, 0x24, 0x33, 0x3, 0x10, 0x39, 0xd0, 0x67, 0x28, 0xa0, 0xe0, 0xfd, 0x36, 0x91, 0x25, 0x37, 0x83}}
return a, nil
}
var __3_rendezvousUpSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x54\xce\xb1\xaa\x83\x40\x10\x85\xe1\x7e\x9f\xe2\x94\x0a\x96\x97\xdb\xa4\x1a\x65\x48\x96\xc4\x4d\x18\x36\x01\x4b\xd1\x21\xd8\xac\xb2\x1a\xc8\xe3\x07\x56\x2d\xec\x86\x8f\x9f\xe1\x54\xc2\xe4\x19\x9e\xca\x1b\x23\xea\x7b\x98\x97\xd8\x2e\xc3\x18\x66\x64\x06\x00\xba\xf1\x13\x16\x8d\xb0\xce\xf3\x99\x05\x0f\xb1\x35\x49\x83\x2b\x37\xa0\xa7\xbf\x5b\x57\x09\xd7\xec\x7c\x91\xf2\x49\x35\xe2\x45\x52\x5d\x48\xb2\xff\xbf\x7c\xd5\x30\xef\x56\x20\x81\x7e\xa7\x21\xea\xfe\x74\xc3\xb6\xef\x63\x0a\x4b\xeb\x48\x1a\x93\x9f\x8c\x39\xec\x0b\x63\xe8\x74\xdb\xb5\xde\x87\xf8\x17\x00\x00\xff\xff\xc3\x3a\x6f\xb8\xcc\x00\x00\x00")
func _3_rendezvousUpSqlBytes() ([]byte, error) {
return bindataRead(
__3_rendezvousUpSql,
"3_rendezvous.up.sql",
)
}
func _3_rendezvousUpSql() (*asset, error) {
bytes, err := _3_rendezvousUpSqlBytes()
if err != nil {
return nil, err
}
info := bindataFileInfo{name: "3_rendezvous.up.sql", size: 204, mode: os.FileMode(0664), modTime: time.Unix(1685637353, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xb4, 0x9e, 0xd1, 0xde, 0xd4, 0xd3, 0x7, 0xc8, 0x7e, 0xa8, 0x54, 0xb5, 0xb3, 0xa1, 0x3c, 0x56, 0xd5, 0xcd, 0x61, 0xed, 0x9c, 0x82, 0x57, 0x24, 0x1f, 0x42, 0x98, 0xf4, 0x33, 0xa4, 0xc0, 0x16}}
return a, nil
}
var __4_signed_peer_recordDownSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x6c\xcc\xb1\xaa\x83\x40\x10\x85\xe1\x7e\x9f\xe2\x94\x0a\x96\x97\xdb\x58\x8d\x66\x48\x96\xc4\x55\x86\x4d\xc0\x52\xe2\x10\x6c\x54\x46\x03\x79\xfc\x80\x89\x5d\xda\xef\xfc\x9c\x83\xd4\x0d\x22\x15\x17\x86\xe9\x63\x58\x56\xeb\xd6\x61\x1a\x97\xdc\xb9\x52\x98\x22\xff\x1a\x91\x38\x00\xb8\x4f\xcf\x71\x55\x83\x0f\x91\x8f\x2c\x68\xc4\x57\x24\x2d\xce\xdc\x82\xae\xb1\xf6\xa1\x14\xae\x38\xc4\x6c\xcb\x67\x55\xc3\x8d\xa4\x3c\x91\x24\xff\x7f\xe9\x47\xc7\x65\xb7\x0c\x1b\xe8\x6b\x1e\x4c\xf7\xd3\x2f\x76\x7d\x6f\x5b\x58\xf8\x40\xd2\xba\x34\x77\xef\x00\x00\x00\xff\xff\x25\xbc\x5b\xc0\xba\x00\x00\x00")
func _4_signed_peer_recordDownSqlBytes() ([]byte, error) {
return bindataRead(
__4_signed_peer_recordDownSql,
"4_signed_peer_record.down.sql",
)
}
func _4_signed_peer_recordDownSql() (*asset, error) {
bytes, err := _4_signed_peer_recordDownSqlBytes()
if err != nil {
return nil, err
}
info := bindataFileInfo{name: "4_signed_peer_record.down.sql", size: 186, mode: os.FileMode(0664), modTime: time.Unix(1685637492, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x3c, 0x8b, 0xe8, 0x6a, 0xb6, 0x92, 0xff, 0x78, 0x83, 0xdb, 0x5d, 0x67, 0x93, 0x4b, 0xe3, 0xb3, 0x16, 0x9e, 0x22, 0x9e, 0xd4, 0xcb, 0xcc, 0x10, 0xf2, 0xa9, 0xa, 0x3c, 0xef, 0x80, 0xe0, 0x13}}
return a, nil
}
var __4_signed_peer_recordUpSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x6c\xcc\x3d\xcb\x83\x30\x10\x07\xf0\x3d\x9f\xe2\x46\x05\xc7\x87\x67\x71\x3a\xed\xd1\x86\xd6\x28\x47\x5a\x70\x2c\x7a\x48\x96\x28\x17\x0b\xfd\xf8\xa5\xb6\x6e\x5d\x7f\xff\x97\x03\xb7\x1d\x78\xac\x2e\x04\x2a\x53\x48\xab\xde\xd7\x30\xc7\x54\x1a\x53\x33\xa1\xa7\x5f\x21\x64\x06\x00\x60\x98\x1f\x71\x15\x05\xeb\x3c\x1d\x89\xa1\x63\xdb\x20\xf7\x70\xa6\x1e\xf0\xea\x5b\xeb\x6a\xa6\x86\x9c\x2f\xb6\xfa\x22\xa2\x70\x43\xae\x4f\xc8\xd9\xff\x5f\xfe\xd1\x98\x76\x2b\x60\x03\x79\x2e\x41\x65\x3f\xfd\x62\x0a\x53\x94\xb1\x13\x51\x96\x61\xd6\xf1\xbd\xa9\xac\x43\xee\x4d\x5e\x9a\x57\x00\x00\x00\xff\xff\x1a\xe7\xdf\x9f\xc5\x00\x00\x00")
func _4_signed_peer_recordUpSqlBytes() ([]byte, error) {
return bindataRead(
__4_signed_peer_recordUpSql,
"4_signed_peer_record.up.sql",
)
}
func _4_signed_peer_recordUpSql() (*asset, error) {
bytes, err := _4_signed_peer_recordUpSqlBytes()
if err != nil {
return nil, err
}
info := bindataFileInfo{name: "4_signed_peer_record.up.sql", size: 197, mode: os.FileMode(0664), modTime: time.Unix(1685637465, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xed, 0xf9, 0xc2, 0x12, 0xe0, 0xbd, 0x3d, 0xc9, 0x37, 0xb9, 0xfe, 0xa0, 0xda, 0x92, 0x99, 0xa8, 0x3a, 0x46, 0x7a, 0x3a, 0x26, 0xc, 0x63, 0x1c, 0x9a, 0x87, 0xce, 0x26, 0x7c, 0x9e, 0x87, 0x28}}
return a, nil
}
var _docGo = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x2c\xc9\xb1\x0d\xc4\x20\x0c\x05\xd0\x9e\x29\xfe\x02\xd8\xfd\x6d\xe3\x4b\xac\x2f\x44\x82\x09\x78\x7f\xa5\x49\xfd\xa6\x1d\xdd\xe8\xd8\xcf\x55\x8a\x2a\xe3\x47\x1f\xbe\x2c\x1d\x8c\xfa\x6f\xe3\xb4\x34\xd4\xd9\x89\xbb\x71\x59\xb6\x18\x1b\x35\x20\xa2\x9f\x0a\x03\xa2\xe5\x0d\x00\x00\xff\xff\x60\xcd\x06\xbe\x4a\x00\x00\x00")
func docGoBytes() ([]byte, error) {
return bindataRead(
_docGo,
"doc.go",
)
}
func docGo() (*asset, error) {
bytes, err := docGoBytes()
if err != nil {
return nil, err
}
info := bindataFileInfo{name: "doc.go", size: 74, mode: os.FileMode(0664), modTime: time.Unix(1673044753, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xde, 0x7c, 0x28, 0xcd, 0x47, 0xf2, 0xfa, 0x7c, 0x51, 0x2d, 0xd8, 0x38, 0xb, 0xb0, 0x34, 0x9d, 0x4c, 0x62, 0xa, 0x9e, 0x28, 0xc3, 0x31, 0x23, 0xd9, 0xbb, 0x89, 0x9f, 0xa0, 0x89, 0x1f, 0xe8}}
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) {
canonicalName := strings.Replace(name, "\\", "/", -1)
if f, ok := _bindata[canonicalName]; 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)
}
// AssetString returns the asset contents as a string (instead of a []byte).
func AssetString(name string) (string, error) {
data, err := Asset(name)
return string(data), err
}
// 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
}
// MustAssetString is like AssetString but panics when Asset would return an
// error. It simplifies safe initialization of global variables.
func MustAssetString(name string) string {
return string(MustAsset(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) {
canonicalName := strings.Replace(name, "\\", "/", -1)
if f, ok := _bindata[canonicalName]; 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)
}
// AssetDigest returns the digest of the file with the given name. It returns an
// error if the asset could not be found or the digest could not be loaded.
func AssetDigest(name string) ([sha256.Size]byte, error) {
canonicalName := strings.Replace(name, "\\", "/", -1)
if f, ok := _bindata[canonicalName]; ok {
a, err := f()
if err != nil {
return [sha256.Size]byte{}, fmt.Errorf("AssetDigest %s can't read by error: %v", name, err)
}
return a.digest, nil
}
return [sha256.Size]byte{}, fmt.Errorf("AssetDigest %s not found", name)
}
// Digests returns a map of all known files and their checksums.
func Digests() (map[string][sha256.Size]byte, error) {
mp := make(map[string][sha256.Size]byte, len(_bindata))
for name := range _bindata {
a, err := _bindata[name]()
if err != nil {
return nil, err
}
mp[name] = a.digest
}
return mp, nil
}
// 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){
"1_messages.down.sql": _1_messagesDownSql,
"1_messages.up.sql": _1_messagesUpSql,
"2_messages_index.down.sql": _2_messages_indexDownSql,
"2_messages_index.up.sql": _2_messages_indexUpSql,
"3_rendezvous.down.sql": _3_rendezvousDownSql,
"3_rendezvous.up.sql": _3_rendezvousUpSql,
"4_signed_peer_record.down.sql": _4_signed_peer_recordDownSql,
"4_signed_peer_record.up.sql": _4_signed_peer_recordUpSql,
"doc.go": docGo,
}
// 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, and
// AssetDir("") will return []string{"data"}.
func AssetDir(name string) ([]string, error) {
node := _bintree
if len(name) != 0 {
canonicalName := strings.Replace(name, "\\", "/", -1)
pathList := strings.Split(canonicalName, "/")
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{
"1_messages.down.sql": &bintree{_1_messagesDownSql, map[string]*bintree{}},
"1_messages.up.sql": &bintree{_1_messagesUpSql, map[string]*bintree{}},
"2_messages_index.down.sql": &bintree{_2_messages_indexDownSql, map[string]*bintree{}},
"2_messages_index.up.sql": &bintree{_2_messages_indexUpSql, map[string]*bintree{}},
"3_rendezvous.down.sql": &bintree{_3_rendezvousDownSql, map[string]*bintree{}},
"3_rendezvous.up.sql": &bintree{_3_rendezvousUpSql, map[string]*bintree{}},
"4_signed_peer_record.down.sql": &bintree{_4_signed_peer_recordDownSql, map[string]*bintree{}},
"4_signed_peer_record.up.sql": &bintree{_4_signed_peer_recordUpSql, map[string]*bintree{}},
"doc.go": &bintree{docGo, 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
}
return os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime())
}
// 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 {
canonicalName := strings.Replace(name, "\\", "/", -1)
return filepath.Join(append([]string{dir}, strings.Split(canonicalName, "/")...)...)
}