feat: Add new settings for include watch-only accounts (#3676)

This commit is contained in:
Khushboo-dev-cpp 2023-06-28 12:05:06 +02:00 committed by GitHub
parent f07a79cd18
commit e1004b4aec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
23 changed files with 1639 additions and 2263 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1 @@
ALTER TABLE settings ADD COLUMN include_watch_only_account BOOLEAN DEFAULT TRUE;

File diff suppressed because it is too large Load Diff

View File

@ -1,15 +1,15 @@
// Code generated by go-bindata. DO NOT EDIT. // Code generated by go-bindata.
// sources: // sources:
// 1557732988_initialize_db.down.sql (72B) // 1557732988_initialize_db.down.sql
// 1557732988_initialize_db.up.sql (278B) // 1557732988_initialize_db.up.sql
// static.go (178B) // static.go
// DO NOT EDIT!
package migrations package migrations
import ( import (
"bytes" "bytes"
"compress/gzip" "compress/gzip"
"crypto/sha256"
"fmt" "fmt"
"io" "io"
"io/ioutil" "io/ioutil"
@ -22,7 +22,7 @@ import (
func bindataRead(data []byte, name string) ([]byte, error) { func bindataRead(data []byte, name string) ([]byte, error) {
gz, err := gzip.NewReader(bytes.NewBuffer(data)) gz, err := gzip.NewReader(bytes.NewBuffer(data))
if err != nil { if err != nil {
return nil, fmt.Errorf("read %q: %v", name, err) return nil, fmt.Errorf("Read %q: %v", name, err)
} }
var buf bytes.Buffer var buf bytes.Buffer
@ -30,7 +30,7 @@ func bindataRead(data []byte, name string) ([]byte, error) {
clErr := gz.Close() clErr := gz.Close()
if err != nil { if err != nil {
return nil, fmt.Errorf("read %q: %v", name, err) return nil, fmt.Errorf("Read %q: %v", name, err)
} }
if clErr != nil { if clErr != nil {
return nil, err return nil, err
@ -40,9 +40,8 @@ func bindataRead(data []byte, name string) ([]byte, error) {
} }
type asset struct { type asset struct {
bytes []byte bytes []byte
info os.FileInfo info os.FileInfo
digest [sha256.Size]byte
} }
type bindataFileInfo struct { type bindataFileInfo struct {
@ -86,8 +85,8 @@ func _1557732988_initialize_dbDownSql() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "1557732988_initialize_db.down.sql", size: 72, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "1557732988_initialize_db.down.sql", size: 72, mode: os.FileMode(436), modTime: time.Unix(1687862442, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x77, 0x40, 0x78, 0xb7, 0x71, 0x3c, 0x20, 0x3b, 0xc9, 0xb, 0x2f, 0x49, 0xe4, 0xff, 0x1c, 0x84, 0x54, 0xa1, 0x30, 0xe3, 0x90, 0xf8, 0x73, 0xda, 0xb0, 0x2a, 0xea, 0x8e, 0xf1, 0x82, 0xe7, 0xd2}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -106,8 +105,8 @@ func _1557732988_initialize_dbUpSql() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "1557732988_initialize_db.up.sql", size: 278, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "1557732988_initialize_db.up.sql", size: 278, mode: os.FileMode(436), modTime: time.Unix(1687862442, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xf5, 0x85, 0x41, 0x7a, 0xba, 0x4f, 0xa3, 0x43, 0xc0, 0x63, 0xfa, 0x2c, 0xd1, 0xc5, 0xbb, 0x20, 0xa0, 0x64, 0xa8, 0x3b, 0x65, 0x82, 0xa2, 0x14, 0x28, 0x18, 0x7c, 0x8b, 0x3a, 0x7a, 0xfd, 0xe0}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -126,8 +125,8 @@ func staticGo() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "static.go", size: 178, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "static.go", size: 178, mode: os.FileMode(436), modTime: time.Unix(1687862442, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xab, 0x8a, 0xf4, 0x27, 0x24, 0x9d, 0x2a, 0x1, 0x7b, 0x54, 0xea, 0xae, 0x4a, 0x35, 0x40, 0x92, 0xb5, 0xf9, 0xb3, 0x54, 0x3e, 0x3a, 0x1a, 0x2b, 0xae, 0xfb, 0x9e, 0x82, 0xeb, 0x4c, 0xf, 0x6}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -135,8 +134,8 @@ func staticGo() (*asset, error) {
// It returns an error if the asset could not be found or // It returns an error if the asset could not be found or
// could not be loaded. // could not be loaded.
func Asset(name string) ([]byte, error) { func Asset(name string) ([]byte, error) {
canonicalName := strings.Replace(name, "\\", "/", -1) cannonicalName := strings.Replace(name, "\\", "/", -1)
if f, ok := _bindata[canonicalName]; ok { if f, ok := _bindata[cannonicalName]; ok {
a, err := f() a, err := f()
if err != nil { if err != nil {
return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err) return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err)
@ -146,12 +145,6 @@ func Asset(name string) ([]byte, error) {
return nil, fmt.Errorf("Asset %s not found", name) 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. // MustAsset is like Asset but panics when Asset would return an error.
// It simplifies safe initialization of global variables. // It simplifies safe initialization of global variables.
func MustAsset(name string) []byte { func MustAsset(name string) []byte {
@ -163,18 +156,12 @@ func MustAsset(name string) []byte {
return a 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. // AssetInfo loads and returns the asset info for the given name.
// It returns an error if the asset could not be found or // It returns an error if the asset could not be found or
// could not be loaded. // could not be loaded.
func AssetInfo(name string) (os.FileInfo, error) { func AssetInfo(name string) (os.FileInfo, error) {
canonicalName := strings.Replace(name, "\\", "/", -1) cannonicalName := strings.Replace(name, "\\", "/", -1)
if f, ok := _bindata[canonicalName]; ok { if f, ok := _bindata[cannonicalName]; ok {
a, err := f() a, err := f()
if err != nil { if err != nil {
return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err) return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err)
@ -184,33 +171,6 @@ func AssetInfo(name string) (os.FileInfo, error) {
return nil, fmt.Errorf("AssetInfo %s not found", name) 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. // AssetNames returns the names of the assets.
func AssetNames() []string { func AssetNames() []string {
names := make([]string, 0, len(_bindata)) names := make([]string, 0, len(_bindata))
@ -223,9 +183,7 @@ func AssetNames() []string {
// _bindata is a table, holding each asset generator, mapped to its name. // _bindata is a table, holding each asset generator, mapped to its name.
var _bindata = map[string]func() (*asset, error){ var _bindata = map[string]func() (*asset, error){
"1557732988_initialize_db.down.sql": _1557732988_initialize_dbDownSql, "1557732988_initialize_db.down.sql": _1557732988_initialize_dbDownSql,
"1557732988_initialize_db.up.sql": _1557732988_initialize_dbUpSql, "1557732988_initialize_db.up.sql": _1557732988_initialize_dbUpSql,
"static.go": staticGo, "static.go": staticGo,
} }
@ -238,15 +196,15 @@ var _bindata = map[string]func() (*asset, error){
// img/ // img/
// a.png // a.png
// b.png // b.png
// then AssetDir("data") would return []string{"foo.txt", "img"}, // then AssetDir("data") would return []string{"foo.txt", "img"}
// AssetDir("data/img") would return []string{"a.png", "b.png"}, // AssetDir("data/img") would return []string{"a.png", "b.png"}
// AssetDir("foo.txt") and AssetDir("notexist") would return an error, and // AssetDir("foo.txt") and AssetDir("notexist") would return an error
// AssetDir("") will return []string{"data"}. // AssetDir("") will return []string{"data"}.
func AssetDir(name string) ([]string, error) { func AssetDir(name string) ([]string, error) {
node := _bintree node := _bintree
if len(name) != 0 { if len(name) != 0 {
canonicalName := strings.Replace(name, "\\", "/", -1) cannonicalName := strings.Replace(name, "\\", "/", -1)
pathList := strings.Split(canonicalName, "/") pathList := strings.Split(cannonicalName, "/")
for _, p := range pathList { for _, p := range pathList {
node = node.Children[p] node = node.Children[p]
if node == nil { if node == nil {
@ -268,14 +226,13 @@ type bintree struct {
Func func() (*asset, error) Func func() (*asset, error)
Children map[string]*bintree Children map[string]*bintree
} }
var _bintree = &bintree{nil, map[string]*bintree{ var _bintree = &bintree{nil, map[string]*bintree{
"1557732988_initialize_db.down.sql": &bintree{_1557732988_initialize_dbDownSql, map[string]*bintree{}}, "1557732988_initialize_db.down.sql": &bintree{_1557732988_initialize_dbDownSql, map[string]*bintree{}},
"1557732988_initialize_db.up.sql": &bintree{_1557732988_initialize_dbUpSql, map[string]*bintree{}}, "1557732988_initialize_db.up.sql": &bintree{_1557732988_initialize_dbUpSql, map[string]*bintree{}},
"static.go": &bintree{staticGo, map[string]*bintree{}}, "static.go": &bintree{staticGo, map[string]*bintree{}},
}} }}
// RestoreAsset restores an asset under the given directory. // RestoreAsset restores an asset under the given directory
func RestoreAsset(dir, name string) error { func RestoreAsset(dir, name string) error {
data, err := Asset(name) data, err := Asset(name)
if err != nil { if err != nil {
@ -293,10 +250,14 @@ func RestoreAsset(dir, name string) error {
if err != nil { if err != nil {
return err return err
} }
return os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime()) 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. // RestoreAssets restores an asset under the given directory recursively
func RestoreAssets(dir, name string) error { func RestoreAssets(dir, name string) error {
children, err := AssetDir(name) children, err := AssetDir(name)
// File // File
@ -314,6 +275,7 @@ func RestoreAssets(dir, name string) error {
} }
func _filePath(dir, name string) string { func _filePath(dir, name string) string {
canonicalName := strings.Replace(name, "\\", "/", -1) cannonicalName := strings.Replace(name, "\\", "/", -1)
return filepath.Join(append([]string{dir}, strings.Split(canonicalName, "/")...)...) return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...)
} }

View File

@ -1,24 +1,24 @@
// Code generated by go-bindata. DO NOT EDIT. // Code generated by go-bindata.
// sources: // sources:
// 0001_accounts.down.sql (21B) // 0001_accounts.down.sql
// 0001_accounts.up.sql (163B) // 0001_accounts.up.sql
// 1605007189_identity_images.down.sql (29B) // 1605007189_identity_images.down.sql
// 1605007189_identity_images.up.sql (268B) // 1605007189_identity_images.up.sql
// 1606224181_drop_photo_path_from_accounts.down.sql (892B) // 1606224181_drop_photo_path_from_accounts.down.sql
// 1606224181_drop_photo_path_from_accounts.up.sql (866B) // 1606224181_drop_photo_path_from_accounts.up.sql
// 1648646095_image_clock.down.sql (939B) // 1648646095_image_clock.down.sql
// 1648646095_image_clock.up.sql (69B) // 1648646095_image_clock.up.sql
// 1649317600_add_color_hash.up.sql (201B) // 1649317600_add_color_hash.up.sql
// 1660238799_accounts_kdf.up.sql (115B) // 1660238799_accounts_kdf.up.sql
// 1679505708_add_customization_color.up.sql (78B) // 1679505708_add_customization_color.up.sql
// doc.go (74B) // doc.go
// DO NOT EDIT!
package migrations package migrations
import ( import (
"bytes" "bytes"
"compress/gzip" "compress/gzip"
"crypto/sha256"
"fmt" "fmt"
"io" "io"
"io/ioutil" "io/ioutil"
@ -31,7 +31,7 @@ import (
func bindataRead(data []byte, name string) ([]byte, error) { func bindataRead(data []byte, name string) ([]byte, error) {
gz, err := gzip.NewReader(bytes.NewBuffer(data)) gz, err := gzip.NewReader(bytes.NewBuffer(data))
if err != nil { if err != nil {
return nil, fmt.Errorf("read %q: %v", name, err) return nil, fmt.Errorf("Read %q: %v", name, err)
} }
var buf bytes.Buffer var buf bytes.Buffer
@ -39,7 +39,7 @@ func bindataRead(data []byte, name string) ([]byte, error) {
clErr := gz.Close() clErr := gz.Close()
if err != nil { if err != nil {
return nil, fmt.Errorf("read %q: %v", name, err) return nil, fmt.Errorf("Read %q: %v", name, err)
} }
if clErr != nil { if clErr != nil {
return nil, err return nil, err
@ -49,9 +49,8 @@ func bindataRead(data []byte, name string) ([]byte, error) {
} }
type asset struct { type asset struct {
bytes []byte bytes []byte
info os.FileInfo info os.FileInfo
digest [sha256.Size]byte
} }
type bindataFileInfo struct { type bindataFileInfo struct {
@ -95,8 +94,8 @@ func _0001_accountsDownSql() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "0001_accounts.down.sql", size: 21, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "0001_accounts.down.sql", size: 21, mode: os.FileMode(436), modTime: time.Unix(1687862441, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xd2, 0x61, 0x4c, 0x18, 0xfc, 0xc, 0xdf, 0x5c, 0x1f, 0x5e, 0xd3, 0xbd, 0xfa, 0x12, 0x5e, 0x8d, 0x8d, 0x8b, 0xb9, 0x5f, 0x99, 0x46, 0x63, 0xa5, 0xe3, 0xa6, 0x8a, 0x4, 0xf1, 0x73, 0x8a, 0xe9}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -115,8 +114,8 @@ func _0001_accountsUpSql() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "0001_accounts.up.sql", size: 163, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "0001_accounts.up.sql", size: 163, mode: os.FileMode(436), modTime: time.Unix(1687862441, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xf2, 0xfa, 0x99, 0x8e, 0x96, 0xb3, 0x13, 0x6c, 0x1f, 0x6, 0x27, 0xc5, 0xd2, 0xd4, 0xe0, 0xa5, 0x26, 0x82, 0xa7, 0x26, 0xf2, 0x68, 0x9d, 0xed, 0x9c, 0x3d, 0xbb, 0xdc, 0x37, 0x28, 0xbc, 0x1}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -135,8 +134,8 @@ func _1605007189_identity_imagesDownSql() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "1605007189_identity_images.down.sql", size: 29, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "1605007189_identity_images.down.sql", size: 29, mode: os.FileMode(436), modTime: time.Unix(1687862441, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x2f, 0xcf, 0xa7, 0xae, 0xd5, 0x4f, 0xcd, 0x14, 0x63, 0x9, 0xbe, 0x39, 0x49, 0x18, 0x96, 0xb2, 0xa3, 0x8, 0x7d, 0x41, 0xdb, 0x50, 0x5d, 0xf5, 0x4d, 0xa2, 0xd, 0x8f, 0x57, 0x79, 0x77, 0x67}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -155,8 +154,8 @@ func _1605007189_identity_imagesUpSql() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "1605007189_identity_images.up.sql", size: 268, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "1605007189_identity_images.up.sql", size: 268, mode: os.FileMode(436), modTime: time.Unix(1687862441, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x50, 0xb6, 0xc1, 0x5c, 0x76, 0x72, 0x6b, 0x22, 0x34, 0xdc, 0x96, 0xdc, 0x2b, 0xfd, 0x2d, 0xbe, 0xcc, 0x1e, 0xd4, 0x5, 0x93, 0xd, 0xc2, 0x51, 0xf3, 0x1a, 0xef, 0x2b, 0x26, 0xa4, 0xeb, 0x65}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -175,8 +174,8 @@ func _1606224181_drop_photo_path_from_accountsDownSql() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "1606224181_drop_photo_path_from_accounts.down.sql", size: 892, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "1606224181_drop_photo_path_from_accounts.down.sql", size: 892, mode: os.FileMode(436), modTime: time.Unix(1687862441, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x90, 0x24, 0x17, 0x7, 0x80, 0x93, 0x6f, 0x8d, 0x5d, 0xaa, 0x8c, 0x79, 0x15, 0x5d, 0xb3, 0x19, 0xd7, 0xd8, 0x39, 0xf9, 0x3a, 0x63, 0x8f, 0x81, 0x15, 0xb6, 0xd6, 0x9a, 0x37, 0xa8, 0x8e, 0x9b}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -195,8 +194,8 @@ func _1606224181_drop_photo_path_from_accountsUpSql() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "1606224181_drop_photo_path_from_accounts.up.sql", size: 866, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "1606224181_drop_photo_path_from_accounts.up.sql", size: 866, mode: os.FileMode(436), modTime: time.Unix(1687862441, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xff, 0x4c, 0x97, 0xee, 0xef, 0x82, 0xb8, 0x6c, 0x71, 0xbb, 0x50, 0x7b, 0xe6, 0xd9, 0x22, 0x31, 0x7c, 0x1a, 0xfe, 0x91, 0x28, 0xf6, 0x6, 0x36, 0xe, 0xb1, 0xf1, 0xc8, 0x25, 0xac, 0x7e, 0xd6}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -215,8 +214,8 @@ func _1648646095_image_clockDownSql() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "1648646095_image_clock.down.sql", size: 939, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "1648646095_image_clock.down.sql", size: 939, mode: os.FileMode(436), modTime: time.Unix(1687862441, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x4d, 0xa8, 0x1f, 0xf, 0xe0, 0xd7, 0xc9, 0x68, 0x98, 0xd8, 0x37, 0xb8, 0xba, 0x9e, 0xb2, 0x19, 0xf3, 0xc4, 0x73, 0x80, 0x3, 0x17, 0x2a, 0x53, 0x68, 0x10, 0x13, 0x54, 0x99, 0xb1, 0xf5, 0x1c}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -235,8 +234,8 @@ func _1648646095_image_clockUpSql() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "1648646095_image_clock.up.sql", size: 69, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "1648646095_image_clock.up.sql", size: 69, mode: os.FileMode(436), modTime: time.Unix(1687862441, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x98, 0xa6, 0xa4, 0x4e, 0x4e, 0xca, 0x17, 0x56, 0xea, 0xfb, 0xf0, 0xa9, 0x81, 0x95, 0xe, 0x80, 0x52, 0x1, 0x47, 0x9b, 0xde, 0x14, 0xfa, 0x72, 0xc9, 0x62, 0x6f, 0x24, 0xa2, 0xc, 0x32, 0x50}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -255,8 +254,8 @@ func _1649317600_add_color_hashUpSql() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "1649317600_add_color_hash.up.sql", size: 201, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "1649317600_add_color_hash.up.sql", size: 201, mode: os.FileMode(436), modTime: time.Unix(1687862441, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x1a, 0xf, 0x37, 0x6d, 0xcf, 0x99, 0xc9, 0x2e, 0xdc, 0x70, 0x11, 0xb4, 0x36, 0x26, 0x4f, 0x39, 0xa8, 0x44, 0xf, 0xcb, 0xcc, 0x81, 0x74, 0x7a, 0x88, 0xaa, 0x54, 0x8c, 0xc4, 0xe, 0x56, 0x4f}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -275,8 +274,8 @@ func _1660238799_accounts_kdfUpSql() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "1660238799_accounts_kdf.up.sql", size: 115, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "1660238799_accounts_kdf.up.sql", size: 115, mode: os.FileMode(436), modTime: time.Unix(1687862441, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xdf, 0xe6, 0x7a, 0x69, 0x25, 0x42, 0x3b, 0x9c, 0x20, 0xf5, 0xcb, 0xae, 0xb0, 0xb3, 0x1b, 0x66, 0xc2, 0x5d, 0xd0, 0xc1, 0x59, 0xe8, 0xa9, 0xc5, 0x69, 0x58, 0x8f, 0xae, 0xe6, 0xd1, 0x4c, 0x53}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -295,8 +294,8 @@ func _1679505708_add_customization_colorUpSql() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "1679505708_add_customization_color.up.sql", size: 78, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "1679505708_add_customization_color.up.sql", size: 78, mode: os.FileMode(436), modTime: time.Unix(1687862441, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xa9, 0xe1, 0x3d, 0xaa, 0x5d, 0x35, 0x87, 0x8a, 0x8b, 0xe9, 0x4a, 0xa6, 0x7b, 0x85, 0xbc, 0x33, 0x11, 0xc7, 0x7d, 0x61, 0xac, 0x65, 0x59, 0xda, 0x32, 0x59, 0x68, 0x9d, 0xa1, 0x10, 0x7b, 0xa9}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -315,8 +314,8 @@ func docGo() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "doc.go", size: 74, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "doc.go", size: 74, mode: os.FileMode(436), modTime: time.Unix(1687862441, 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}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -324,8 +323,8 @@ func docGo() (*asset, error) {
// It returns an error if the asset could not be found or // It returns an error if the asset could not be found or
// could not be loaded. // could not be loaded.
func Asset(name string) ([]byte, error) { func Asset(name string) ([]byte, error) {
canonicalName := strings.Replace(name, "\\", "/", -1) cannonicalName := strings.Replace(name, "\\", "/", -1)
if f, ok := _bindata[canonicalName]; ok { if f, ok := _bindata[cannonicalName]; ok {
a, err := f() a, err := f()
if err != nil { if err != nil {
return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err) return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err)
@ -335,12 +334,6 @@ func Asset(name string) ([]byte, error) {
return nil, fmt.Errorf("Asset %s not found", name) 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. // MustAsset is like Asset but panics when Asset would return an error.
// It simplifies safe initialization of global variables. // It simplifies safe initialization of global variables.
func MustAsset(name string) []byte { func MustAsset(name string) []byte {
@ -352,18 +345,12 @@ func MustAsset(name string) []byte {
return a 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. // AssetInfo loads and returns the asset info for the given name.
// It returns an error if the asset could not be found or // It returns an error if the asset could not be found or
// could not be loaded. // could not be loaded.
func AssetInfo(name string) (os.FileInfo, error) { func AssetInfo(name string) (os.FileInfo, error) {
canonicalName := strings.Replace(name, "\\", "/", -1) cannonicalName := strings.Replace(name, "\\", "/", -1)
if f, ok := _bindata[canonicalName]; ok { if f, ok := _bindata[cannonicalName]; ok {
a, err := f() a, err := f()
if err != nil { if err != nil {
return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err) return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err)
@ -373,33 +360,6 @@ func AssetInfo(name string) (os.FileInfo, error) {
return nil, fmt.Errorf("AssetInfo %s not found", name) 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. // AssetNames returns the names of the assets.
func AssetNames() []string { func AssetNames() []string {
names := make([]string, 0, len(_bindata)) names := make([]string, 0, len(_bindata))
@ -412,27 +372,16 @@ func AssetNames() []string {
// _bindata is a table, holding each asset generator, mapped to its name. // _bindata is a table, holding each asset generator, mapped to its name.
var _bindata = map[string]func() (*asset, error){ var _bindata = map[string]func() (*asset, error){
"0001_accounts.down.sql": _0001_accountsDownSql, "0001_accounts.down.sql": _0001_accountsDownSql,
"0001_accounts.up.sql": _0001_accountsUpSql, "0001_accounts.up.sql": _0001_accountsUpSql,
"1605007189_identity_images.down.sql": _1605007189_identity_imagesDownSql, "1605007189_identity_images.down.sql": _1605007189_identity_imagesDownSql,
"1605007189_identity_images.up.sql": _1605007189_identity_imagesUpSql, "1605007189_identity_images.up.sql": _1605007189_identity_imagesUpSql,
"1606224181_drop_photo_path_from_accounts.down.sql": _1606224181_drop_photo_path_from_accountsDownSql, "1606224181_drop_photo_path_from_accounts.down.sql": _1606224181_drop_photo_path_from_accountsDownSql,
"1606224181_drop_photo_path_from_accounts.up.sql": _1606224181_drop_photo_path_from_accountsUpSql, "1606224181_drop_photo_path_from_accounts.up.sql": _1606224181_drop_photo_path_from_accountsUpSql,
"1648646095_image_clock.down.sql": _1648646095_image_clockDownSql, "1648646095_image_clock.down.sql": _1648646095_image_clockDownSql,
"1648646095_image_clock.up.sql": _1648646095_image_clockUpSql, "1648646095_image_clock.up.sql": _1648646095_image_clockUpSql,
"1649317600_add_color_hash.up.sql": _1649317600_add_color_hashUpSql, "1649317600_add_color_hash.up.sql": _1649317600_add_color_hashUpSql,
"1660238799_accounts_kdf.up.sql": _1660238799_accounts_kdfUpSql, "1660238799_accounts_kdf.up.sql": _1660238799_accounts_kdfUpSql,
"1679505708_add_customization_color.up.sql": _1679505708_add_customization_colorUpSql, "1679505708_add_customization_color.up.sql": _1679505708_add_customization_colorUpSql,
"doc.go": docGo, "doc.go": docGo,
} }
@ -445,15 +394,15 @@ var _bindata = map[string]func() (*asset, error){
// img/ // img/
// a.png // a.png
// b.png // b.png
// then AssetDir("data") would return []string{"foo.txt", "img"}, // then AssetDir("data") would return []string{"foo.txt", "img"}
// AssetDir("data/img") would return []string{"a.png", "b.png"}, // AssetDir("data/img") would return []string{"a.png", "b.png"}
// AssetDir("foo.txt") and AssetDir("notexist") would return an error, and // AssetDir("foo.txt") and AssetDir("notexist") would return an error
// AssetDir("") will return []string{"data"}. // AssetDir("") will return []string{"data"}.
func AssetDir(name string) ([]string, error) { func AssetDir(name string) ([]string, error) {
node := _bintree node := _bintree
if len(name) != 0 { if len(name) != 0 {
canonicalName := strings.Replace(name, "\\", "/", -1) cannonicalName := strings.Replace(name, "\\", "/", -1)
pathList := strings.Split(canonicalName, "/") pathList := strings.Split(cannonicalName, "/")
for _, p := range pathList { for _, p := range pathList {
node = node.Children[p] node = node.Children[p]
if node == nil { if node == nil {
@ -475,23 +424,22 @@ type bintree struct {
Func func() (*asset, error) Func func() (*asset, error)
Children map[string]*bintree Children map[string]*bintree
} }
var _bintree = &bintree{nil, map[string]*bintree{ var _bintree = &bintree{nil, map[string]*bintree{
"0001_accounts.down.sql": &bintree{_0001_accountsDownSql, map[string]*bintree{}}, "0001_accounts.down.sql": &bintree{_0001_accountsDownSql, map[string]*bintree{}},
"0001_accounts.up.sql": &bintree{_0001_accountsUpSql, map[string]*bintree{}}, "0001_accounts.up.sql": &bintree{_0001_accountsUpSql, map[string]*bintree{}},
"1605007189_identity_images.down.sql": &bintree{_1605007189_identity_imagesDownSql, map[string]*bintree{}}, "1605007189_identity_images.down.sql": &bintree{_1605007189_identity_imagesDownSql, map[string]*bintree{}},
"1605007189_identity_images.up.sql": &bintree{_1605007189_identity_imagesUpSql, map[string]*bintree{}}, "1605007189_identity_images.up.sql": &bintree{_1605007189_identity_imagesUpSql, map[string]*bintree{}},
"1606224181_drop_photo_path_from_accounts.down.sql": &bintree{_1606224181_drop_photo_path_from_accountsDownSql, map[string]*bintree{}}, "1606224181_drop_photo_path_from_accounts.down.sql": &bintree{_1606224181_drop_photo_path_from_accountsDownSql, map[string]*bintree{}},
"1606224181_drop_photo_path_from_accounts.up.sql": &bintree{_1606224181_drop_photo_path_from_accountsUpSql, map[string]*bintree{}}, "1606224181_drop_photo_path_from_accounts.up.sql": &bintree{_1606224181_drop_photo_path_from_accountsUpSql, map[string]*bintree{}},
"1648646095_image_clock.down.sql": &bintree{_1648646095_image_clockDownSql, map[string]*bintree{}}, "1648646095_image_clock.down.sql": &bintree{_1648646095_image_clockDownSql, map[string]*bintree{}},
"1648646095_image_clock.up.sql": &bintree{_1648646095_image_clockUpSql, map[string]*bintree{}}, "1648646095_image_clock.up.sql": &bintree{_1648646095_image_clockUpSql, map[string]*bintree{}},
"1649317600_add_color_hash.up.sql": &bintree{_1649317600_add_color_hashUpSql, map[string]*bintree{}}, "1649317600_add_color_hash.up.sql": &bintree{_1649317600_add_color_hashUpSql, map[string]*bintree{}},
"1660238799_accounts_kdf.up.sql": &bintree{_1660238799_accounts_kdfUpSql, map[string]*bintree{}}, "1660238799_accounts_kdf.up.sql": &bintree{_1660238799_accounts_kdfUpSql, map[string]*bintree{}},
"1679505708_add_customization_color.up.sql": &bintree{_1679505708_add_customization_colorUpSql, map[string]*bintree{}}, "1679505708_add_customization_color.up.sql": &bintree{_1679505708_add_customization_colorUpSql, map[string]*bintree{}},
"doc.go": &bintree{docGo, map[string]*bintree{}}, "doc.go": &bintree{docGo, map[string]*bintree{}},
}} }}
// RestoreAsset restores an asset under the given directory. // RestoreAsset restores an asset under the given directory
func RestoreAsset(dir, name string) error { func RestoreAsset(dir, name string) error {
data, err := Asset(name) data, err := Asset(name)
if err != nil { if err != nil {
@ -509,10 +457,14 @@ func RestoreAsset(dir, name string) error {
if err != nil { if err != nil {
return err return err
} }
return os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime()) 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. // RestoreAssets restores an asset under the given directory recursively
func RestoreAssets(dir, name string) error { func RestoreAssets(dir, name string) error {
children, err := AssetDir(name) children, err := AssetDir(name)
// File // File
@ -530,6 +482,7 @@ func RestoreAssets(dir, name string) error {
} }
func _filePath(dir, name string) string { func _filePath(dir, name string) string {
canonicalName := strings.Replace(name, "\\", "/", -1) cannonicalName := strings.Replace(name, "\\", "/", -1)
return filepath.Join(append([]string{dir}, strings.Split(canonicalName, "/")...)...) return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...)
} }

View File

@ -436,6 +436,17 @@ var (
dBColumnName: "address", dBColumnName: "address",
valueHandler: AddressHandler, valueHandler: AddressHandler,
} }
IncludeWatchOnlyAccount = SettingField{
reactFieldName: "include-watch-only-account?",
dBColumnName: "include_watch_only_account",
valueHandler: BoolHandler,
syncProtobufFactory: &SyncProtobufFactory{
fromInterface: includeWatchOnlyAccountProtobufFactory,
fromStruct: includeWatchOnlyAccountProtobufFactoryStruct,
valueFromProtobuf: BoolFromSyncProtobuf,
protobufType: protobuf.SyncSetting_INCLUDE_WATCHONLY_ACCOUNT,
},
}
SettingFieldRegister = []SettingField{ SettingFieldRegister = []SettingField{
AnonMetricsShouldSend, AnonMetricsShouldSend,
@ -504,6 +515,7 @@ var (
WalletSetUpPassed, WalletSetUpPassed,
WalletVisibleTokens, WalletVisibleTokens,
WebviewAllowPermissionRequests, WebviewAllowPermissionRequests,
IncludeWatchOnlyAccount,
} }
) )

View File

@ -301,7 +301,7 @@ func (db *Database) SetSettingLastSynced(setting SettingField, clock uint64) err
func (db *Database) GetSettings() (Settings, error) { func (db *Database) GetSettings() (Settings, error) {
var s Settings var s Settings
err := db.db.QueryRow("SELECT address, anon_metrics_should_send, chaos_mode, currency, current_network, custom_bootnodes, custom_bootnodes_enabled, dapps_address, display_name, bio, eip1581_address, fleet, hide_home_tooltip, installation_id, key_uid, keycard_instance_uid, keycard_paired_on, keycard_pairing, last_updated, latest_derived_path, link_preview_request_enabled, link_previews_enabled_sites, log_level, mnemonic, mnemonic_removed, name, networks, notifications_enabled, push_notifications_server_enabled, push_notifications_from_contacts_only, remote_push_notifications_enabled, send_push_notifications, push_notifications_block_mentions, photo_path, pinned_mailservers, preferred_name, preview_privacy, public_key, remember_syncing_choice, signing_phrase, stickers_packs_installed, stickers_packs_pending, stickers_recent_stickers, syncing_on_mobile_network, default_sync_period, use_mailservers, messages_from_contacts_only, usernames, appearance, profile_pictures_show_to, profile_pictures_visibility, wallet_root_address, wallet_set_up_passed, wallet_visible_tokens, waku_bloom_filter_mode, webview_allow_permission_requests, current_user_status, send_status_updates, gif_recents, gif_favorites, opensea_enabled, last_backup, backup_enabled, telemetry_server_url, auto_message_enabled, gif_api_key, test_networks_enabled, mutual_contact_enabled FROM settings WHERE synthetic_id = 'id'").Scan( err := db.db.QueryRow("SELECT address, anon_metrics_should_send, chaos_mode, currency, current_network, custom_bootnodes, custom_bootnodes_enabled, dapps_address, display_name, bio, eip1581_address, fleet, hide_home_tooltip, installation_id, key_uid, keycard_instance_uid, keycard_paired_on, keycard_pairing, last_updated, latest_derived_path, link_preview_request_enabled, link_previews_enabled_sites, log_level, mnemonic, mnemonic_removed, name, networks, notifications_enabled, push_notifications_server_enabled, push_notifications_from_contacts_only, remote_push_notifications_enabled, send_push_notifications, push_notifications_block_mentions, photo_path, pinned_mailservers, preferred_name, preview_privacy, public_key, remember_syncing_choice, signing_phrase, stickers_packs_installed, stickers_packs_pending, stickers_recent_stickers, syncing_on_mobile_network, default_sync_period, use_mailservers, messages_from_contacts_only, usernames, appearance, profile_pictures_show_to, profile_pictures_visibility, wallet_root_address, wallet_set_up_passed, wallet_visible_tokens, waku_bloom_filter_mode, webview_allow_permission_requests, current_user_status, send_status_updates, gif_recents, gif_favorites, opensea_enabled, last_backup, backup_enabled, telemetry_server_url, auto_message_enabled, gif_api_key, test_networks_enabled, mutual_contact_enabled, include_watch_only_account FROM settings WHERE synthetic_id = 'id'").Scan(
&s.Address, &s.Address,
&s.AnonMetricsShouldSend, &s.AnonMetricsShouldSend,
&s.ChaosMode, &s.ChaosMode,
@ -370,6 +370,7 @@ func (db *Database) GetSettings() (Settings, error) {
&s.GifAPIKey, &s.GifAPIKey,
&s.TestNetworksEnabled, &s.TestNetworksEnabled,
&s.MutualContactEnabled, &s.MutualContactEnabled,
&s.IncludeWatchOnlyAccount,
) )
return s, err return s, err
@ -646,3 +647,8 @@ func (db *Database) GetTestNetworksEnabled() (result bool, err error) {
func (db *Database) GetTelemetryServerURL() (string, error) { func (db *Database) GetTelemetryServerURL() (string, error) {
return db.makeSelectString(TelemetryServerURL) return db.makeSelectString(TelemetryServerURL)
} }
func (db *Database) IncludeWatchOnlyAccount() (result bool, err error) {
err = db.makeSelectRow(IncludeWatchOnlyAccount).Scan(&result)
return result, err
}

View File

@ -189,6 +189,7 @@ type Settings struct {
AutoMessageEnabled bool `json:"auto-message-enabled?,omitempty"` AutoMessageEnabled bool `json:"auto-message-enabled?,omitempty"`
GifAPIKey string `json:"gifs/api-key"` GifAPIKey string `json:"gifs/api-key"`
TestNetworksEnabled bool `json:"test-networks-enabled?,omitempty"` TestNetworksEnabled bool `json:"test-networks-enabled?,omitempty"`
IncludeWatchOnlyAccount bool `json:"include-watch-only-account?,omitempty"`
} }
func (s Settings) MarshalJSON() ([]byte, error) { func (s Settings) MarshalJSON() ([]byte, error) {

View File

@ -540,3 +540,28 @@ func usernamesProtobufFactoryStruct(s Settings, clock uint64, chatID string) (*c
us := extractJSONRawMessage(s.Usernames) us := extractJSONRawMessage(s.Usernames)
return buildRawUsernamesSyncMessage(us, clock, chatID) return buildRawUsernamesSyncMessage(us, clock, chatID)
} }
// IncludeWatchOnlyAccount
func buildRawIncludeWatchOnlyAccountSyncMessage(v bool, clock uint64, chatID string) (*common.RawMessage, *protobuf.SyncSetting, error) {
pb := &protobuf.SyncSetting{
Type: protobuf.SyncSetting_INCLUDE_WATCHONLY_ACCOUNT,
Value: &protobuf.SyncSetting_ValueBool{ValueBool: v},
Clock: clock,
}
rm, err := buildRawSyncSettingMessage(pb, chatID)
return rm, pb, err
}
func includeWatchOnlyAccountProtobufFactory(value interface{}, clock uint64, chatID string) (*common.RawMessage, *protobuf.SyncSetting, error) {
v, err := assertBool(value)
if err != nil {
return nil, nil, err
}
return buildRawIncludeWatchOnlyAccountSyncMessage(v, clock, chatID)
}
func includeWatchOnlyAccountProtobufFactoryStruct(s Settings, clock uint64, chatID string) (*common.RawMessage, *protobuf.SyncSetting, error) {
return buildRawIncludeWatchOnlyAccountSyncMessage(s.IncludeWatchOnlyAccount, clock, chatID)
}

View File

@ -1,15 +1,15 @@
// Code generated by go-bindata. DO NOT EDIT. // Code generated by go-bindata.
// sources: // sources:
// 1619446565_postgres_make_anon_metrics_table.down.sql (24B) // 1619446565_postgres_make_anon_metrics_table.down.sql
// 1619446565_postgres_make_anon_metrics_table.up.sql (443B) // 1619446565_postgres_make_anon_metrics_table.up.sql
// doc.go (380B) // doc.go
// DO NOT EDIT!
package migrations package migrations
import ( import (
"bytes" "bytes"
"compress/gzip" "compress/gzip"
"crypto/sha256"
"fmt" "fmt"
"io" "io"
"io/ioutil" "io/ioutil"
@ -22,7 +22,7 @@ import (
func bindataRead(data []byte, name string) ([]byte, error) { func bindataRead(data []byte, name string) ([]byte, error) {
gz, err := gzip.NewReader(bytes.NewBuffer(data)) gz, err := gzip.NewReader(bytes.NewBuffer(data))
if err != nil { if err != nil {
return nil, fmt.Errorf("read %q: %v", name, err) return nil, fmt.Errorf("Read %q: %v", name, err)
} }
var buf bytes.Buffer var buf bytes.Buffer
@ -30,7 +30,7 @@ func bindataRead(data []byte, name string) ([]byte, error) {
clErr := gz.Close() clErr := gz.Close()
if err != nil { if err != nil {
return nil, fmt.Errorf("read %q: %v", name, err) return nil, fmt.Errorf("Read %q: %v", name, err)
} }
if clErr != nil { if clErr != nil {
return nil, err return nil, err
@ -40,9 +40,8 @@ func bindataRead(data []byte, name string) ([]byte, error) {
} }
type asset struct { type asset struct {
bytes []byte bytes []byte
info os.FileInfo info os.FileInfo
digest [sha256.Size]byte
} }
type bindataFileInfo struct { type bindataFileInfo struct {
@ -86,8 +85,8 @@ func _1619446565_postgres_make_anon_metrics_tableDownSql() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "1619446565_postgres_make_anon_metrics_table.down.sql", size: 24, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "1619446565_postgres_make_anon_metrics_table.down.sql", size: 24, mode: os.FileMode(436), modTime: time.Unix(1687862441, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x75, 0xea, 0x1, 0x74, 0xe6, 0xa3, 0x11, 0xd0, 0x86, 0x87, 0x7e, 0x31, 0xb4, 0x1a, 0x27, 0x5d, 0xda, 0x77, 0xa3, 0xf5, 0x1d, 0x88, 0x79, 0xcf, 0xd5, 0x95, 0x75, 0xd, 0x47, 0xa1, 0x90, 0x5}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -106,8 +105,8 @@ func _1619446565_postgres_make_anon_metrics_tableUpSql() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "1619446565_postgres_make_anon_metrics_table.up.sql", size: 443, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "1619446565_postgres_make_anon_metrics_table.up.sql", size: 443, mode: os.FileMode(436), modTime: time.Unix(1687862441, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xd5, 0xdc, 0x72, 0x28, 0x3c, 0xf6, 0x94, 0xb0, 0x47, 0x3d, 0xca, 0x55, 0x3d, 0xf7, 0x83, 0xb8, 0x7d, 0x2f, 0x1e, 0x98, 0xb7, 0xde, 0xa, 0xff, 0xa0, 0x52, 0x60, 0x83, 0x56, 0xc5, 0xd1, 0xa2}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -126,8 +125,8 @@ func docGo() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "doc.go", size: 380, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "doc.go", size: 380, mode: os.FileMode(436), modTime: time.Unix(1687862441, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x49, 0x1, 0xd4, 0xd6, 0xc7, 0x44, 0xd4, 0xfd, 0x7b, 0x69, 0x1f, 0xe3, 0xe, 0x48, 0x14, 0x99, 0xf0, 0x8e, 0x43, 0xae, 0x54, 0x64, 0xa2, 0x8b, 0x82, 0x1c, 0x2b, 0xb, 0xec, 0xf5, 0xb3, 0xfc}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -135,8 +134,8 @@ func docGo() (*asset, error) {
// It returns an error if the asset could not be found or // It returns an error if the asset could not be found or
// could not be loaded. // could not be loaded.
func Asset(name string) ([]byte, error) { func Asset(name string) ([]byte, error) {
canonicalName := strings.Replace(name, "\\", "/", -1) cannonicalName := strings.Replace(name, "\\", "/", -1)
if f, ok := _bindata[canonicalName]; ok { if f, ok := _bindata[cannonicalName]; ok {
a, err := f() a, err := f()
if err != nil { if err != nil {
return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err) return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err)
@ -146,12 +145,6 @@ func Asset(name string) ([]byte, error) {
return nil, fmt.Errorf("Asset %s not found", name) 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. // MustAsset is like Asset but panics when Asset would return an error.
// It simplifies safe initialization of global variables. // It simplifies safe initialization of global variables.
func MustAsset(name string) []byte { func MustAsset(name string) []byte {
@ -163,18 +156,12 @@ func MustAsset(name string) []byte {
return a 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. // AssetInfo loads and returns the asset info for the given name.
// It returns an error if the asset could not be found or // It returns an error if the asset could not be found or
// could not be loaded. // could not be loaded.
func AssetInfo(name string) (os.FileInfo, error) { func AssetInfo(name string) (os.FileInfo, error) {
canonicalName := strings.Replace(name, "\\", "/", -1) cannonicalName := strings.Replace(name, "\\", "/", -1)
if f, ok := _bindata[canonicalName]; ok { if f, ok := _bindata[cannonicalName]; ok {
a, err := f() a, err := f()
if err != nil { if err != nil {
return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err) return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err)
@ -184,33 +171,6 @@ func AssetInfo(name string) (os.FileInfo, error) {
return nil, fmt.Errorf("AssetInfo %s not found", name) 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. // AssetNames returns the names of the assets.
func AssetNames() []string { func AssetNames() []string {
names := make([]string, 0, len(_bindata)) names := make([]string, 0, len(_bindata))
@ -223,9 +183,7 @@ func AssetNames() []string {
// _bindata is a table, holding each asset generator, mapped to its name. // _bindata is a table, holding each asset generator, mapped to its name.
var _bindata = map[string]func() (*asset, error){ var _bindata = map[string]func() (*asset, error){
"1619446565_postgres_make_anon_metrics_table.down.sql": _1619446565_postgres_make_anon_metrics_tableDownSql, "1619446565_postgres_make_anon_metrics_table.down.sql": _1619446565_postgres_make_anon_metrics_tableDownSql,
"1619446565_postgres_make_anon_metrics_table.up.sql": _1619446565_postgres_make_anon_metrics_tableUpSql, "1619446565_postgres_make_anon_metrics_table.up.sql": _1619446565_postgres_make_anon_metrics_tableUpSql,
"doc.go": docGo, "doc.go": docGo,
} }
@ -238,15 +196,15 @@ var _bindata = map[string]func() (*asset, error){
// img/ // img/
// a.png // a.png
// b.png // b.png
// then AssetDir("data") would return []string{"foo.txt", "img"}, // then AssetDir("data") would return []string{"foo.txt", "img"}
// AssetDir("data/img") would return []string{"a.png", "b.png"}, // AssetDir("data/img") would return []string{"a.png", "b.png"}
// AssetDir("foo.txt") and AssetDir("notexist") would return an error, and // AssetDir("foo.txt") and AssetDir("notexist") would return an error
// AssetDir("") will return []string{"data"}. // AssetDir("") will return []string{"data"}.
func AssetDir(name string) ([]string, error) { func AssetDir(name string) ([]string, error) {
node := _bintree node := _bintree
if len(name) != 0 { if len(name) != 0 {
canonicalName := strings.Replace(name, "\\", "/", -1) cannonicalName := strings.Replace(name, "\\", "/", -1)
pathList := strings.Split(canonicalName, "/") pathList := strings.Split(cannonicalName, "/")
for _, p := range pathList { for _, p := range pathList {
node = node.Children[p] node = node.Children[p]
if node == nil { if node == nil {
@ -268,14 +226,13 @@ type bintree struct {
Func func() (*asset, error) Func func() (*asset, error)
Children map[string]*bintree Children map[string]*bintree
} }
var _bintree = &bintree{nil, map[string]*bintree{ var _bintree = &bintree{nil, map[string]*bintree{
"1619446565_postgres_make_anon_metrics_table.down.sql": &bintree{_1619446565_postgres_make_anon_metrics_tableDownSql, map[string]*bintree{}}, "1619446565_postgres_make_anon_metrics_table.down.sql": &bintree{_1619446565_postgres_make_anon_metrics_tableDownSql, map[string]*bintree{}},
"1619446565_postgres_make_anon_metrics_table.up.sql": &bintree{_1619446565_postgres_make_anon_metrics_tableUpSql, map[string]*bintree{}}, "1619446565_postgres_make_anon_metrics_table.up.sql": &bintree{_1619446565_postgres_make_anon_metrics_tableUpSql, map[string]*bintree{}},
"doc.go": &bintree{docGo, map[string]*bintree{}}, "doc.go": &bintree{docGo, map[string]*bintree{}},
}} }}
// RestoreAsset restores an asset under the given directory. // RestoreAsset restores an asset under the given directory
func RestoreAsset(dir, name string) error { func RestoreAsset(dir, name string) error {
data, err := Asset(name) data, err := Asset(name)
if err != nil { if err != nil {
@ -293,10 +250,14 @@ func RestoreAsset(dir, name string) error {
if err != nil { if err != nil {
return err return err
} }
return os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime()) 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. // RestoreAssets restores an asset under the given directory recursively
func RestoreAssets(dir, name string) error { func RestoreAssets(dir, name string) error {
children, err := AssetDir(name) children, err := AssetDir(name)
// File // File
@ -314,6 +275,7 @@ func RestoreAssets(dir, name string) error {
} }
func _filePath(dir, name string) string { func _filePath(dir, name string) string {
canonicalName := strings.Replace(name, "\\", "/", -1) cannonicalName := strings.Replace(name, "\\", "/", -1)
return filepath.Join(append([]string{dir}, strings.Split(canonicalName, "/")...)...) return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...)
} }

View File

@ -1,32 +1,32 @@
// Code generated by go-bindata. DO NOT EDIT. // Code generated by go-bindata.
// sources: // sources:
// 1536754952_initial_schema.down.sql (83B) // 1536754952_initial_schema.down.sql
// 1536754952_initial_schema.up.sql (962B) // 1536754952_initial_schema.up.sql
// 1539249977_update_ratchet_info.down.sql (311B) // 1539249977_update_ratchet_info.down.sql
// 1539249977_update_ratchet_info.up.sql (368B) // 1539249977_update_ratchet_info.up.sql
// 1540715431_add_version.down.sql (127B) // 1540715431_add_version.down.sql
// 1540715431_add_version.up.sql (265B) // 1540715431_add_version.up.sql
// 1541164797_add_installations.down.sql (26B) // 1541164797_add_installations.down.sql
// 1541164797_add_installations.up.sql (216B) // 1541164797_add_installations.up.sql
// 1558084410_add_secret.down.sql (56B) // 1558084410_add_secret.down.sql
// 1558084410_add_secret.up.sql (301B) // 1558084410_add_secret.up.sql
// 1558588866_add_version.down.sql (47B) // 1558588866_add_version.down.sql
// 1558588866_add_version.up.sql (57B) // 1558588866_add_version.up.sql
// 1559627659_add_contact_code.down.sql (32B) // 1559627659_add_contact_code.down.sql
// 1559627659_add_contact_code.up.sql (198B) // 1559627659_add_contact_code.up.sql
// 1561368210_add_installation_metadata.down.sql (35B) // 1561368210_add_installation_metadata.down.sql
// 1561368210_add_installation_metadata.up.sql (267B) // 1561368210_add_installation_metadata.up.sql
// 1632236298_add_communities.down.sql (151B) // 1632236298_add_communities.down.sql
// 1632236298_add_communities.up.sql (584B) // 1632236298_add_communities.up.sql
// 1636536507_add_index_bundles.up.sql (347B) // 1636536507_add_index_bundles.up.sql
// doc.go (377B) // doc.go
// DO NOT EDIT!
package migrations package migrations
import ( import (
"bytes" "bytes"
"compress/gzip" "compress/gzip"
"crypto/sha256"
"fmt" "fmt"
"io" "io"
"io/ioutil" "io/ioutil"
@ -39,7 +39,7 @@ import (
func bindataRead(data []byte, name string) ([]byte, error) { func bindataRead(data []byte, name string) ([]byte, error) {
gz, err := gzip.NewReader(bytes.NewBuffer(data)) gz, err := gzip.NewReader(bytes.NewBuffer(data))
if err != nil { if err != nil {
return nil, fmt.Errorf("read %q: %v", name, err) return nil, fmt.Errorf("Read %q: %v", name, err)
} }
var buf bytes.Buffer var buf bytes.Buffer
@ -47,7 +47,7 @@ func bindataRead(data []byte, name string) ([]byte, error) {
clErr := gz.Close() clErr := gz.Close()
if err != nil { if err != nil {
return nil, fmt.Errorf("read %q: %v", name, err) return nil, fmt.Errorf("Read %q: %v", name, err)
} }
if clErr != nil { if clErr != nil {
return nil, err return nil, err
@ -57,9 +57,8 @@ func bindataRead(data []byte, name string) ([]byte, error) {
} }
type asset struct { type asset struct {
bytes []byte bytes []byte
info os.FileInfo info os.FileInfo
digest [sha256.Size]byte
} }
type bindataFileInfo struct { type bindataFileInfo struct {
@ -103,8 +102,8 @@ func _1536754952_initial_schemaDownSql() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "1536754952_initial_schema.down.sql", size: 83, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "1536754952_initial_schema.down.sql", size: 83, mode: os.FileMode(436), modTime: time.Unix(1687862441, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x44, 0xcf, 0x76, 0x71, 0x1f, 0x5e, 0x9a, 0x43, 0xd8, 0xcd, 0xb8, 0xc3, 0x70, 0xc3, 0x7f, 0xfc, 0x90, 0xb4, 0x25, 0x1e, 0xf4, 0x66, 0x20, 0xb8, 0x33, 0x7e, 0xb0, 0x76, 0x1f, 0xc, 0xc0, 0x75}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -123,8 +122,8 @@ func _1536754952_initial_schemaUpSql() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "1536754952_initial_schema.up.sql", size: 962, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "1536754952_initial_schema.up.sql", size: 962, mode: os.FileMode(436), modTime: time.Unix(1687862441, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xea, 0x90, 0x5a, 0x59, 0x3e, 0x3, 0xe2, 0x3c, 0x81, 0x42, 0xcd, 0x4c, 0x9a, 0xe8, 0xda, 0x93, 0x2b, 0x70, 0xa4, 0xd5, 0x29, 0x3e, 0xd5, 0xc9, 0x27, 0xb6, 0xb7, 0x65, 0xff, 0x0, 0xcb, 0xde}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -143,8 +142,8 @@ func _1539249977_update_ratchet_infoDownSql() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "1539249977_update_ratchet_info.down.sql", size: 311, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "1539249977_update_ratchet_info.down.sql", size: 311, mode: os.FileMode(436), modTime: time.Unix(1687862441, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x1, 0xa4, 0xeb, 0xa0, 0xe6, 0xa0, 0xd4, 0x48, 0xbb, 0xad, 0x6f, 0x7d, 0x67, 0x8c, 0xbd, 0x25, 0xde, 0x1f, 0x73, 0x9a, 0xbb, 0xa8, 0xc9, 0x30, 0xb7, 0xa9, 0x7c, 0xaf, 0xb5, 0x1, 0x61, 0xdd}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -163,8 +162,8 @@ func _1539249977_update_ratchet_infoUpSql() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "1539249977_update_ratchet_info.up.sql", size: 368, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "1539249977_update_ratchet_info.up.sql", size: 368, mode: os.FileMode(436), modTime: time.Unix(1687862441, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xc, 0x8e, 0xbf, 0x6f, 0xa, 0xc0, 0xe1, 0x3c, 0x42, 0x28, 0x88, 0x1d, 0xdb, 0xba, 0x1c, 0x83, 0xec, 0xba, 0xd3, 0x5f, 0x5c, 0x77, 0x5e, 0xa7, 0x46, 0x36, 0xec, 0x69, 0xa, 0x4b, 0x17, 0x79}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -183,8 +182,8 @@ func _1540715431_add_versionDownSql() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "1540715431_add_version.down.sql", size: 127, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "1540715431_add_version.down.sql", size: 127, mode: os.FileMode(436), modTime: time.Unix(1687862441, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xf5, 0x9, 0x4, 0xe3, 0x76, 0x2e, 0xb8, 0x9, 0x23, 0xf0, 0x70, 0x93, 0xc4, 0x50, 0xe, 0x9d, 0x84, 0x22, 0x8c, 0x94, 0xd3, 0x24, 0x9, 0x9a, 0xc1, 0xa1, 0x48, 0x45, 0xfd, 0x40, 0x6e, 0xe6}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -203,8 +202,8 @@ func _1540715431_add_versionUpSql() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "1540715431_add_version.up.sql", size: 265, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "1540715431_add_version.up.sql", size: 265, mode: os.FileMode(436), modTime: time.Unix(1687862441, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xc7, 0x4c, 0x36, 0x96, 0xdf, 0x16, 0x10, 0xa6, 0x27, 0x1a, 0x79, 0x8b, 0x42, 0x83, 0x23, 0xc, 0x7e, 0xb6, 0x3d, 0x2, 0xda, 0xa4, 0xb4, 0xd, 0x27, 0x55, 0xba, 0xdc, 0xb2, 0x88, 0x8f, 0xa6}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -223,8 +222,8 @@ func _1541164797_add_installationsDownSql() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "1541164797_add_installations.down.sql", size: 26, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "1541164797_add_installations.down.sql", size: 26, mode: os.FileMode(436), modTime: time.Unix(1687862441, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xf5, 0xfd, 0xe6, 0xd8, 0xca, 0x3b, 0x38, 0x18, 0xee, 0x0, 0x5f, 0x36, 0x9e, 0x1e, 0xd, 0x19, 0x3e, 0xb4, 0x73, 0x53, 0xe9, 0xa5, 0xac, 0xdd, 0xa1, 0x2f, 0xc7, 0x6c, 0xa8, 0xd9, 0xa, 0x88}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -243,8 +242,8 @@ func _1541164797_add_installationsUpSql() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "1541164797_add_installations.up.sql", size: 216, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "1541164797_add_installations.up.sql", size: 216, mode: os.FileMode(436), modTime: time.Unix(1687862441, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x2d, 0x18, 0x26, 0xb8, 0x88, 0x47, 0xdb, 0x83, 0xcc, 0xb6, 0x9d, 0x1c, 0x1, 0xae, 0x2f, 0xde, 0x97, 0x82, 0x3, 0x30, 0xa8, 0x63, 0xa1, 0x78, 0x4b, 0xa5, 0x9, 0x8, 0x75, 0xa2, 0x57, 0x81}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -263,8 +262,8 @@ func _1558084410_add_secretDownSql() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "1558084410_add_secret.down.sql", size: 56, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "1558084410_add_secret.down.sql", size: 56, mode: os.FileMode(436), modTime: time.Unix(1687862441, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x49, 0xb, 0x65, 0xdf, 0x59, 0xbf, 0xe9, 0x5, 0x5b, 0x6f, 0xd5, 0x3a, 0xb7, 0x57, 0xe8, 0x78, 0x38, 0x73, 0x53, 0x57, 0xf7, 0x24, 0x4, 0xe4, 0xa2, 0x49, 0x22, 0xa2, 0xc6, 0xfd, 0x80, 0xa4}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -283,8 +282,8 @@ func _1558084410_add_secretUpSql() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "1558084410_add_secret.up.sql", size: 301, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "1558084410_add_secret.up.sql", size: 301, mode: os.FileMode(436), modTime: time.Unix(1687862441, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xf5, 0x32, 0x36, 0x8e, 0x47, 0xb0, 0x8f, 0xc1, 0xc6, 0xf7, 0xc6, 0x9f, 0x2d, 0x44, 0x75, 0x2b, 0x26, 0xec, 0x6, 0xa0, 0x7b, 0xa5, 0xbd, 0xc8, 0x76, 0x8a, 0x82, 0x68, 0x2, 0x42, 0xb5, 0xf4}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -303,8 +302,8 @@ func _1558588866_add_versionDownSql() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "1558588866_add_version.down.sql", size: 47, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "1558588866_add_version.down.sql", size: 47, mode: os.FileMode(436), modTime: time.Unix(1687862441, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xde, 0x52, 0x34, 0x3c, 0x46, 0x4a, 0xf0, 0x72, 0x47, 0x6f, 0x49, 0x5c, 0xc7, 0xf9, 0x32, 0xce, 0xc4, 0x3d, 0xfd, 0x61, 0xa1, 0x8b, 0x8f, 0xf2, 0x31, 0x34, 0xde, 0x15, 0x49, 0xa6, 0xde, 0xb9}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -323,8 +322,8 @@ func _1558588866_add_versionUpSql() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "1558588866_add_version.up.sql", size: 57, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "1558588866_add_version.up.sql", size: 57, mode: os.FileMode(436), modTime: time.Unix(1687862441, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x2a, 0xea, 0x64, 0x39, 0x61, 0x20, 0x83, 0x83, 0xb, 0x2e, 0x79, 0x64, 0xb, 0x53, 0xfa, 0xfe, 0xc6, 0xf7, 0x67, 0x42, 0xd3, 0x4f, 0xdc, 0x7e, 0x30, 0x32, 0xe8, 0x14, 0x41, 0xe9, 0xe7, 0x3b}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -343,8 +342,8 @@ func _1559627659_add_contact_codeDownSql() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "1559627659_add_contact_code.down.sql", size: 32, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "1559627659_add_contact_code.down.sql", size: 32, mode: os.FileMode(436), modTime: time.Unix(1687862441, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x5d, 0x64, 0x6d, 0xce, 0x24, 0x42, 0x20, 0x8d, 0x4f, 0x37, 0xaa, 0x9d, 0xc, 0x57, 0x98, 0xc1, 0xd1, 0x1a, 0x34, 0xcd, 0x9f, 0x8f, 0x34, 0x86, 0xb3, 0xd3, 0xdc, 0xf1, 0x7d, 0xe5, 0x1b, 0x6e}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -363,8 +362,8 @@ func _1559627659_add_contact_codeUpSql() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "1559627659_add_contact_code.up.sql", size: 198, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "1559627659_add_contact_code.up.sql", size: 198, mode: os.FileMode(436), modTime: time.Unix(1687862441, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x16, 0xf6, 0xc2, 0x62, 0x9c, 0xd2, 0xc9, 0x1e, 0xd8, 0xea, 0xaa, 0xea, 0x95, 0x8f, 0x89, 0x6a, 0x85, 0x5d, 0x9d, 0x99, 0x78, 0x3c, 0x90, 0x66, 0x99, 0x3e, 0x4b, 0x19, 0x62, 0xfb, 0x31, 0x4d}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -383,8 +382,8 @@ func _1561368210_add_installation_metadataDownSql() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "1561368210_add_installation_metadata.down.sql", size: 35, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "1561368210_add_installation_metadata.down.sql", size: 35, mode: os.FileMode(436), modTime: time.Unix(1687862441, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xa8, 0xde, 0x3f, 0xd2, 0x4a, 0x50, 0x98, 0x56, 0xe3, 0xc0, 0xcd, 0x9d, 0xb0, 0x34, 0x3b, 0xe5, 0x62, 0x18, 0xb5, 0x20, 0xc9, 0x3e, 0xdc, 0x6a, 0x40, 0x36, 0x66, 0xea, 0x51, 0x8c, 0x71, 0xf5}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -403,8 +402,8 @@ func _1561368210_add_installation_metadataUpSql() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "1561368210_add_installation_metadata.up.sql", size: 267, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "1561368210_add_installation_metadata.up.sql", size: 267, mode: os.FileMode(436), modTime: time.Unix(1687862441, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xb4, 0x71, 0x8f, 0x29, 0xb1, 0xaa, 0xd6, 0xd1, 0x8c, 0x17, 0xef, 0x6c, 0xd5, 0x80, 0xb8, 0x2c, 0xc3, 0xfe, 0xec, 0x24, 0x4d, 0xc8, 0x25, 0xd3, 0xb4, 0xcd, 0xa9, 0xac, 0x63, 0x61, 0xb2, 0x9c}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -423,8 +422,8 @@ func _1632236298_add_communitiesDownSql() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "1632236298_add_communities.down.sql", size: 151, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "1632236298_add_communities.down.sql", size: 151, mode: os.FileMode(436), modTime: time.Unix(1687862441, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x26, 0xe5, 0x47, 0xd1, 0xe5, 0xec, 0x5b, 0x3e, 0xdc, 0x22, 0xf4, 0x27, 0xee, 0x70, 0xf3, 0x9, 0x4f, 0xd2, 0x9f, 0x92, 0xf, 0x5a, 0x18, 0x11, 0xb7, 0x40, 0xab, 0xf1, 0x98, 0x72, 0xd6, 0x60}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -443,8 +442,8 @@ func _1632236298_add_communitiesUpSql() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "1632236298_add_communities.up.sql", size: 584, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "1632236298_add_communities.up.sql", size: 584, mode: os.FileMode(436), modTime: time.Unix(1687862441, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x8f, 0xe0, 0x1, 0x6e, 0x84, 0xc, 0x35, 0xe4, 0x5a, 0xf, 0xbe, 0xcb, 0xf7, 0xd2, 0xa8, 0x25, 0xf5, 0xdb, 0x7, 0xcb, 0xa3, 0xe6, 0xf4, 0xc4, 0x1b, 0xa5, 0xec, 0x32, 0x1e, 0x1e, 0x48, 0x60}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -463,8 +462,8 @@ func _1636536507_add_index_bundlesUpSql() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "1636536507_add_index_bundles.up.sql", size: 347, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "1636536507_add_index_bundles.up.sql", size: 347, mode: os.FileMode(436), modTime: time.Unix(1687862441, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xf1, 0xb9, 0x3c, 0x16, 0xfc, 0xfb, 0xb2, 0xb4, 0x3b, 0xfe, 0xdc, 0xf5, 0x9c, 0x42, 0xa0, 0xa0, 0xd4, 0xd, 0x5b, 0x97, 0x10, 0x80, 0x95, 0xe, 0x13, 0xc1, 0x18, 0x8, 0xee, 0xf, 0x99, 0xee}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -483,8 +482,8 @@ func docGo() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "doc.go", size: 377, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "doc.go", size: 377, mode: os.FileMode(436), modTime: time.Unix(1687862441, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xef, 0xaf, 0xdf, 0xcf, 0x65, 0xae, 0x19, 0xfc, 0x9d, 0x29, 0xc1, 0x91, 0xaf, 0xb5, 0xd5, 0xb1, 0x56, 0xf3, 0xee, 0xa8, 0xba, 0x13, 0x65, 0xdb, 0xab, 0xcf, 0x4e, 0xac, 0x92, 0xe9, 0x60, 0xf1}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -492,8 +491,8 @@ func docGo() (*asset, error) {
// It returns an error if the asset could not be found or // It returns an error if the asset could not be found or
// could not be loaded. // could not be loaded.
func Asset(name string) ([]byte, error) { func Asset(name string) ([]byte, error) {
canonicalName := strings.Replace(name, "\\", "/", -1) cannonicalName := strings.Replace(name, "\\", "/", -1)
if f, ok := _bindata[canonicalName]; ok { if f, ok := _bindata[cannonicalName]; ok {
a, err := f() a, err := f()
if err != nil { if err != nil {
return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err) return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err)
@ -503,12 +502,6 @@ func Asset(name string) ([]byte, error) {
return nil, fmt.Errorf("Asset %s not found", name) 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. // MustAsset is like Asset but panics when Asset would return an error.
// It simplifies safe initialization of global variables. // It simplifies safe initialization of global variables.
func MustAsset(name string) []byte { func MustAsset(name string) []byte {
@ -520,18 +513,12 @@ func MustAsset(name string) []byte {
return a 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. // AssetInfo loads and returns the asset info for the given name.
// It returns an error if the asset could not be found or // It returns an error if the asset could not be found or
// could not be loaded. // could not be loaded.
func AssetInfo(name string) (os.FileInfo, error) { func AssetInfo(name string) (os.FileInfo, error) {
canonicalName := strings.Replace(name, "\\", "/", -1) cannonicalName := strings.Replace(name, "\\", "/", -1)
if f, ok := _bindata[canonicalName]; ok { if f, ok := _bindata[cannonicalName]; ok {
a, err := f() a, err := f()
if err != nil { if err != nil {
return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err) return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err)
@ -541,33 +528,6 @@ func AssetInfo(name string) (os.FileInfo, error) {
return nil, fmt.Errorf("AssetInfo %s not found", name) 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. // AssetNames returns the names of the assets.
func AssetNames() []string { func AssetNames() []string {
names := make([]string, 0, len(_bindata)) names := make([]string, 0, len(_bindata))
@ -580,43 +540,24 @@ func AssetNames() []string {
// _bindata is a table, holding each asset generator, mapped to its name. // _bindata is a table, holding each asset generator, mapped to its name.
var _bindata = map[string]func() (*asset, error){ var _bindata = map[string]func() (*asset, error){
"1536754952_initial_schema.down.sql": _1536754952_initial_schemaDownSql, "1536754952_initial_schema.down.sql": _1536754952_initial_schemaDownSql,
"1536754952_initial_schema.up.sql": _1536754952_initial_schemaUpSql, "1536754952_initial_schema.up.sql": _1536754952_initial_schemaUpSql,
"1539249977_update_ratchet_info.down.sql": _1539249977_update_ratchet_infoDownSql, "1539249977_update_ratchet_info.down.sql": _1539249977_update_ratchet_infoDownSql,
"1539249977_update_ratchet_info.up.sql": _1539249977_update_ratchet_infoUpSql, "1539249977_update_ratchet_info.up.sql": _1539249977_update_ratchet_infoUpSql,
"1540715431_add_version.down.sql": _1540715431_add_versionDownSql, "1540715431_add_version.down.sql": _1540715431_add_versionDownSql,
"1540715431_add_version.up.sql": _1540715431_add_versionUpSql, "1540715431_add_version.up.sql": _1540715431_add_versionUpSql,
"1541164797_add_installations.down.sql": _1541164797_add_installationsDownSql, "1541164797_add_installations.down.sql": _1541164797_add_installationsDownSql,
"1541164797_add_installations.up.sql": _1541164797_add_installationsUpSql, "1541164797_add_installations.up.sql": _1541164797_add_installationsUpSql,
"1558084410_add_secret.down.sql": _1558084410_add_secretDownSql, "1558084410_add_secret.down.sql": _1558084410_add_secretDownSql,
"1558084410_add_secret.up.sql": _1558084410_add_secretUpSql, "1558084410_add_secret.up.sql": _1558084410_add_secretUpSql,
"1558588866_add_version.down.sql": _1558588866_add_versionDownSql, "1558588866_add_version.down.sql": _1558588866_add_versionDownSql,
"1558588866_add_version.up.sql": _1558588866_add_versionUpSql, "1558588866_add_version.up.sql": _1558588866_add_versionUpSql,
"1559627659_add_contact_code.down.sql": _1559627659_add_contact_codeDownSql, "1559627659_add_contact_code.down.sql": _1559627659_add_contact_codeDownSql,
"1559627659_add_contact_code.up.sql": _1559627659_add_contact_codeUpSql, "1559627659_add_contact_code.up.sql": _1559627659_add_contact_codeUpSql,
"1561368210_add_installation_metadata.down.sql": _1561368210_add_installation_metadataDownSql, "1561368210_add_installation_metadata.down.sql": _1561368210_add_installation_metadataDownSql,
"1561368210_add_installation_metadata.up.sql": _1561368210_add_installation_metadataUpSql, "1561368210_add_installation_metadata.up.sql": _1561368210_add_installation_metadataUpSql,
"1632236298_add_communities.down.sql": _1632236298_add_communitiesDownSql, "1632236298_add_communities.down.sql": _1632236298_add_communitiesDownSql,
"1632236298_add_communities.up.sql": _1632236298_add_communitiesUpSql, "1632236298_add_communities.up.sql": _1632236298_add_communitiesUpSql,
"1636536507_add_index_bundles.up.sql": _1636536507_add_index_bundlesUpSql, "1636536507_add_index_bundles.up.sql": _1636536507_add_index_bundlesUpSql,
"doc.go": docGo, "doc.go": docGo,
} }
@ -629,15 +570,15 @@ var _bindata = map[string]func() (*asset, error){
// img/ // img/
// a.png // a.png
// b.png // b.png
// then AssetDir("data") would return []string{"foo.txt", "img"}, // then AssetDir("data") would return []string{"foo.txt", "img"}
// AssetDir("data/img") would return []string{"a.png", "b.png"}, // AssetDir("data/img") would return []string{"a.png", "b.png"}
// AssetDir("foo.txt") and AssetDir("notexist") would return an error, and // AssetDir("foo.txt") and AssetDir("notexist") would return an error
// AssetDir("") will return []string{"data"}. // AssetDir("") will return []string{"data"}.
func AssetDir(name string) ([]string, error) { func AssetDir(name string) ([]string, error) {
node := _bintree node := _bintree
if len(name) != 0 { if len(name) != 0 {
canonicalName := strings.Replace(name, "\\", "/", -1) cannonicalName := strings.Replace(name, "\\", "/", -1)
pathList := strings.Split(canonicalName, "/") pathList := strings.Split(cannonicalName, "/")
for _, p := range pathList { for _, p := range pathList {
node = node.Children[p] node = node.Children[p]
if node == nil { if node == nil {
@ -659,31 +600,30 @@ type bintree struct {
Func func() (*asset, error) Func func() (*asset, error)
Children map[string]*bintree Children map[string]*bintree
} }
var _bintree = &bintree{nil, map[string]*bintree{ var _bintree = &bintree{nil, map[string]*bintree{
"1536754952_initial_schema.down.sql": &bintree{_1536754952_initial_schemaDownSql, map[string]*bintree{}}, "1536754952_initial_schema.down.sql": &bintree{_1536754952_initial_schemaDownSql, map[string]*bintree{}},
"1536754952_initial_schema.up.sql": &bintree{_1536754952_initial_schemaUpSql, map[string]*bintree{}}, "1536754952_initial_schema.up.sql": &bintree{_1536754952_initial_schemaUpSql, map[string]*bintree{}},
"1539249977_update_ratchet_info.down.sql": &bintree{_1539249977_update_ratchet_infoDownSql, map[string]*bintree{}}, "1539249977_update_ratchet_info.down.sql": &bintree{_1539249977_update_ratchet_infoDownSql, map[string]*bintree{}},
"1539249977_update_ratchet_info.up.sql": &bintree{_1539249977_update_ratchet_infoUpSql, map[string]*bintree{}}, "1539249977_update_ratchet_info.up.sql": &bintree{_1539249977_update_ratchet_infoUpSql, map[string]*bintree{}},
"1540715431_add_version.down.sql": &bintree{_1540715431_add_versionDownSql, map[string]*bintree{}}, "1540715431_add_version.down.sql": &bintree{_1540715431_add_versionDownSql, map[string]*bintree{}},
"1540715431_add_version.up.sql": &bintree{_1540715431_add_versionUpSql, map[string]*bintree{}}, "1540715431_add_version.up.sql": &bintree{_1540715431_add_versionUpSql, map[string]*bintree{}},
"1541164797_add_installations.down.sql": &bintree{_1541164797_add_installationsDownSql, map[string]*bintree{}}, "1541164797_add_installations.down.sql": &bintree{_1541164797_add_installationsDownSql, map[string]*bintree{}},
"1541164797_add_installations.up.sql": &bintree{_1541164797_add_installationsUpSql, map[string]*bintree{}}, "1541164797_add_installations.up.sql": &bintree{_1541164797_add_installationsUpSql, map[string]*bintree{}},
"1558084410_add_secret.down.sql": &bintree{_1558084410_add_secretDownSql, map[string]*bintree{}}, "1558084410_add_secret.down.sql": &bintree{_1558084410_add_secretDownSql, map[string]*bintree{}},
"1558084410_add_secret.up.sql": &bintree{_1558084410_add_secretUpSql, map[string]*bintree{}}, "1558084410_add_secret.up.sql": &bintree{_1558084410_add_secretUpSql, map[string]*bintree{}},
"1558588866_add_version.down.sql": &bintree{_1558588866_add_versionDownSql, map[string]*bintree{}}, "1558588866_add_version.down.sql": &bintree{_1558588866_add_versionDownSql, map[string]*bintree{}},
"1558588866_add_version.up.sql": &bintree{_1558588866_add_versionUpSql, map[string]*bintree{}}, "1558588866_add_version.up.sql": &bintree{_1558588866_add_versionUpSql, map[string]*bintree{}},
"1559627659_add_contact_code.down.sql": &bintree{_1559627659_add_contact_codeDownSql, map[string]*bintree{}}, "1559627659_add_contact_code.down.sql": &bintree{_1559627659_add_contact_codeDownSql, map[string]*bintree{}},
"1559627659_add_contact_code.up.sql": &bintree{_1559627659_add_contact_codeUpSql, map[string]*bintree{}}, "1559627659_add_contact_code.up.sql": &bintree{_1559627659_add_contact_codeUpSql, map[string]*bintree{}},
"1561368210_add_installation_metadata.down.sql": &bintree{_1561368210_add_installation_metadataDownSql, map[string]*bintree{}}, "1561368210_add_installation_metadata.down.sql": &bintree{_1561368210_add_installation_metadataDownSql, map[string]*bintree{}},
"1561368210_add_installation_metadata.up.sql": &bintree{_1561368210_add_installation_metadataUpSql, map[string]*bintree{}}, "1561368210_add_installation_metadata.up.sql": &bintree{_1561368210_add_installation_metadataUpSql, map[string]*bintree{}},
"1632236298_add_communities.down.sql": &bintree{_1632236298_add_communitiesDownSql, map[string]*bintree{}}, "1632236298_add_communities.down.sql": &bintree{_1632236298_add_communitiesDownSql, map[string]*bintree{}},
"1632236298_add_communities.up.sql": &bintree{_1632236298_add_communitiesUpSql, map[string]*bintree{}}, "1632236298_add_communities.up.sql": &bintree{_1632236298_add_communitiesUpSql, map[string]*bintree{}},
"1636536507_add_index_bundles.up.sql": &bintree{_1636536507_add_index_bundlesUpSql, map[string]*bintree{}}, "1636536507_add_index_bundles.up.sql": &bintree{_1636536507_add_index_bundlesUpSql, map[string]*bintree{}},
"doc.go": &bintree{docGo, map[string]*bintree{}}, "doc.go": &bintree{docGo, map[string]*bintree{}},
}} }}
// RestoreAsset restores an asset under the given directory. // RestoreAsset restores an asset under the given directory
func RestoreAsset(dir, name string) error { func RestoreAsset(dir, name string) error {
data, err := Asset(name) data, err := Asset(name)
if err != nil { if err != nil {
@ -701,10 +641,14 @@ func RestoreAsset(dir, name string) error {
if err != nil { if err != nil {
return err return err
} }
return os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime()) 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. // RestoreAssets restores an asset under the given directory recursively
func RestoreAssets(dir, name string) error { func RestoreAssets(dir, name string) error {
children, err := AssetDir(name) children, err := AssetDir(name)
// File // File
@ -722,6 +666,7 @@ func RestoreAssets(dir, name string) error {
} }
func _filePath(dir, name string) string { func _filePath(dir, name string) string {
canonicalName := strings.Replace(name, "\\", "/", -1) cannonicalName := strings.Replace(name, "\\", "/", -1)
return filepath.Join(append([]string{dir}, strings.Split(canonicalName, "/")...)...) return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...)
} }

File diff suppressed because it is too large Load Diff

View File

@ -6,7 +6,7 @@ package protobuf
import ( import (
fmt "fmt" fmt "fmt"
proto "github.com/golang/protobuf/proto" proto "github.com/golang/protobuf/proto"
timestamp "github.com/golang/protobuf/ptypes/timestamp" timestamppb "google.golang.org/protobuf/types/known/timestamppb"
math "math" math "math"
) )
@ -36,10 +36,10 @@ type AnonymousMetric struct {
// session_id is the id of the session the metric was recorded in // session_id is the id of the session the metric was recorded in
SessionId string `protobuf:"bytes,6,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` SessionId string `protobuf:"bytes,6,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"`
// created_at is the datetime at which the metric was stored in the local db // created_at is the datetime at which the metric was stored in the local db
CreatedAt *timestamp.Timestamp `protobuf:"bytes,7,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` CreatedAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"` XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"` XXX_sizecache int32 `json:"-"`
} }
func (m *AnonymousMetric) Reset() { *m = AnonymousMetric{} } func (m *AnonymousMetric) Reset() { *m = AnonymousMetric{} }
@ -109,7 +109,7 @@ func (m *AnonymousMetric) GetSessionId() string {
return "" return ""
} }
func (m *AnonymousMetric) GetCreatedAt() *timestamp.Timestamp { func (m *AnonymousMetric) GetCreatedAt() *timestamppb.Timestamp {
if m != nil { if m != nil {
return m.CreatedAt return m.CreatedAt
} }

View File

@ -955,6 +955,7 @@ type ChatMessage struct {
// The type of the content of the message // The type of the content of the message
ContentType ChatMessage_ContentType `protobuf:"varint,8,opt,name=content_type,json=contentType,proto3,enum=protobuf.ChatMessage_ContentType" json:"content_type,omitempty"` ContentType ChatMessage_ContentType `protobuf:"varint,8,opt,name=content_type,json=contentType,proto3,enum=protobuf.ChatMessage_ContentType" json:"content_type,omitempty"`
// Types that are valid to be assigned to Payload: // Types that are valid to be assigned to Payload:
//
// *ChatMessage_Sticker // *ChatMessage_Sticker
// *ChatMessage_Image // *ChatMessage_Image
// *ChatMessage_Audio // *ChatMessage_Audio

View File

@ -166,6 +166,7 @@ type MembershipUpdateMessage struct {
// An optional chat message // An optional chat message
// //
// Types that are valid to be assigned to ChatEntity: // Types that are valid to be assigned to ChatEntity:
//
// *MembershipUpdateMessage_Message // *MembershipUpdateMessage_Message
// *MembershipUpdateMessage_EmojiReaction // *MembershipUpdateMessage_EmojiReaction
ChatEntity isMembershipUpdateMessage_ChatEntity `protobuf_oneof:"chat_entity"` ChatEntity isMembershipUpdateMessage_ChatEntity `protobuf_oneof:"chat_entity"`

View File

@ -55,16 +55,16 @@ func (StatusUpdate_StatusType) EnumDescriptor() ([]byte, []int) {
} }
// Specs: // Specs:
//:AUTOMATIC // :AUTOMATIC
//To Send - "AUTOMATIC" status ping every 5 minutes // To Send - "AUTOMATIC" status ping every 5 minutes
//Display - Online for up to 5 minutes from the last clock, after that Offline // Display - Online for up to 5 minutes from the last clock, after that Offline
//:ALWAYS_ONLINE // :ALWAYS_ONLINE
//To Send - "ALWAYS_ONLINE" status ping every 5 minutes // To Send - "ALWAYS_ONLINE" status ping every 5 minutes
//Display - Online for up to 2 weeks from the last clock, after that Offline // Display - Online for up to 2 weeks from the last clock, after that Offline
//:INACTIVE // :INACTIVE
//To Send - A single "INACTIVE" status ping // To Send - A single "INACTIVE" status ping
//Display - Offline forever // Display - Offline forever
//Note: Only send pings if the user interacted with the app in the last x minutes. // Note: Only send pings if the user interacted with the app in the last x minutes.
type StatusUpdate struct { type StatusUpdate struct {
Clock uint64 `protobuf:"varint,1,opt,name=clock,proto3" json:"clock,omitempty"` Clock uint64 `protobuf:"varint,1,opt,name=clock,proto3" json:"clock,omitempty"`
StatusType StatusUpdate_StatusType `protobuf:"varint,2,opt,name=status_type,json=statusType,proto3,enum=protobuf.StatusUpdate_StatusType" json:"status_type,omitempty"` StatusType StatusUpdate_StatusType `protobuf:"varint,2,opt,name=status_type,json=statusType,proto3,enum=protobuf.StatusUpdate_StatusType" json:"status_type,omitempty"`

View File

@ -40,6 +40,7 @@ const (
SyncSetting_BIO SyncSetting_Type = 14 SyncSetting_BIO SyncSetting_Type = 14
SyncSetting_MNEMONIC_REMOVED SyncSetting_Type = 15 SyncSetting_MNEMONIC_REMOVED SyncSetting_Type = 15
SyncSetting_ENS_USERNAMES SyncSetting_Type = 16 SyncSetting_ENS_USERNAMES SyncSetting_Type = 16
SyncSetting_INCLUDE_WATCHONLY_ACCOUNT SyncSetting_Type = 17
) )
var SyncSetting_Type_name = map[int32]string{ var SyncSetting_Type_name = map[int32]string{
@ -60,6 +61,7 @@ var SyncSetting_Type_name = map[int32]string{
14: "BIO", 14: "BIO",
15: "MNEMONIC_REMOVED", 15: "MNEMONIC_REMOVED",
16: "ENS_USERNAMES", 16: "ENS_USERNAMES",
17: "INCLUDE_WATCHONLY_ACCOUNT",
} }
var SyncSetting_Type_value = map[string]int32{ var SyncSetting_Type_value = map[string]int32{
@ -80,6 +82,7 @@ var SyncSetting_Type_value = map[string]int32{
"BIO": 14, "BIO": 14,
"MNEMONIC_REMOVED": 15, "MNEMONIC_REMOVED": 15,
"ENS_USERNAMES": 16, "ENS_USERNAMES": 16,
"INCLUDE_WATCHONLY_ACCOUNT": 17,
} }
func (x SyncSetting_Type) String() string { func (x SyncSetting_Type) String() string {
@ -94,6 +97,7 @@ type SyncSetting struct {
Type SyncSetting_Type `protobuf:"varint,1,opt,name=type,proto3,enum=protobuf.SyncSetting_Type" json:"type,omitempty"` Type SyncSetting_Type `protobuf:"varint,1,opt,name=type,proto3,enum=protobuf.SyncSetting_Type" json:"type,omitempty"`
Clock uint64 `protobuf:"varint,2,opt,name=clock,proto3" json:"clock,omitempty"` Clock uint64 `protobuf:"varint,2,opt,name=clock,proto3" json:"clock,omitempty"`
// Types that are valid to be assigned to Value: // Types that are valid to be assigned to Value:
//
// *SyncSetting_ValueString // *SyncSetting_ValueString
// *SyncSetting_ValueBytes // *SyncSetting_ValueBytes
// *SyncSetting_ValueBool // *SyncSetting_ValueBool
@ -226,36 +230,38 @@ func init() {
} }
var fileDescriptor_e2f7a0bce2873c78 = []byte{ var fileDescriptor_e2f7a0bce2873c78 = []byte{
// 492 bytes of a gzipped FileDescriptorProto // 517 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x92, 0x4b, 0x6f, 0xda, 0x40, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x92, 0x5f, 0x6f, 0xd3, 0x3c,
0x10, 0x80, 0x71, 0x30, 0x81, 0x8c, 0x79, 0x6c, 0x97, 0xa8, 0xb5, 0xd2, 0x4a, 0x71, 0xd3, 0x8b, 0x14, 0xc6, 0x9b, 0xb5, 0x5d, 0xbb, 0xd3, 0x6e, 0xf3, 0xbc, 0xe9, 0x7d, 0xc3, 0x00, 0x2d, 0x8c,
0x4f, 0xae, 0xd4, 0x56, 0xbd, 0xf4, 0x64, 0xec, 0x05, 0x56, 0xd8, 0x6b, 0x6b, 0x67, 0x0d, 0xa2, 0x9b, 0x5c, 0x05, 0x09, 0x10, 0x37, 0x5c, 0xb9, 0xce, 0xe9, 0x6a, 0x2d, 0xb1, 0x23, 0xdb, 0x69,
0x97, 0x55, 0x41, 0x34, 0x42, 0x45, 0x18, 0x05, 0xa7, 0x12, 0xf7, 0xfe, 0xdf, 0xfe, 0x85, 0xca, 0x55, 0x6e, 0x2c, 0x56, 0x95, 0x69, 0xa2, 0x6a, 0xa6, 0x35, 0x43, 0xea, 0x97, 0xe0, 0x4b, 0xf0,
0x76, 0xe9, 0xf3, 0x64, 0xcf, 0x37, 0xdf, 0xcc, 0xce, 0x3e, 0x60, 0x78, 0x3c, 0xed, 0xd7, 0xfa, 0x45, 0x51, 0x12, 0xca, 0xdf, 0x2b, 0xfb, 0x3c, 0xe7, 0x77, 0x1e, 0x1f, 0x1f, 0x1b, 0x4e, 0x37,
0xb8, 0x29, 0x8a, 0xed, 0xfe, 0xfe, 0xe8, 0x1d, 0x1e, 0xf2, 0x22, 0xa7, 0x9d, 0xea, 0xb3, 0x7a, 0xdb, 0xf5, 0xc2, 0x6d, 0x96, 0x65, 0x79, 0xb7, 0xbe, 0xdd, 0x44, 0xf7, 0x0f, 0x45, 0x59, 0xd0,
0xfc, 0x7c, 0xf7, 0xdd, 0x04, 0x0b, 0x4f, 0xfb, 0x35, 0xd6, 0x02, 0xf5, 0xc0, 0x2c, 0x4e, 0x87, 0x7e, 0xbd, 0xdc, 0x3c, 0x7e, 0xba, 0xfc, 0xda, 0x85, 0x81, 0xd9, 0xae, 0x17, 0xa6, 0x01, 0x68,
0x8d, 0x6d, 0x38, 0x86, 0xdb, 0x7f, 0x73, 0xe3, 0x9d, 0x45, 0xef, 0x0f, 0xc9, 0x53, 0xa7, 0xc3, 0x04, 0x9d, 0x72, 0x7b, 0xbf, 0xf4, 0xbd, 0xc0, 0x0b, 0x8f, 0x5e, 0x9f, 0x47, 0x3b, 0x30, 0xfa,
0x46, 0x56, 0x1e, 0xbd, 0x86, 0xd6, 0x7a, 0x97, 0xaf, 0xbf, 0xd8, 0x17, 0x8e, 0xe1, 0x9a, 0xb2, 0x0d, 0x8a, 0xec, 0xf6, 0x7e, 0xa9, 0x6b, 0x8e, 0x9e, 0x41, 0x77, 0xb1, 0x2a, 0x16, 0x9f, 0xfd,
0x0e, 0xe8, 0x2b, 0xe8, 0x7e, 0xfd, 0xb4, 0x7b, 0xdc, 0xe8, 0x63, 0xf1, 0xb0, 0xdd, 0xdf, 0xdb, 0xbd, 0xc0, 0x0b, 0x3b, 0xba, 0x09, 0xe8, 0x4b, 0x18, 0x7e, 0xf9, 0xb8, 0x7a, 0x5c, 0xba, 0x4d,
0x4d, 0xc7, 0x70, 0xaf, 0xa6, 0x0d, 0x69, 0x55, 0x14, 0x2b, 0x48, 0x5f, 0x42, 0x1d, 0xea, 0xd5, 0xf9, 0x70, 0xb7, 0xbe, 0xf5, 0xdb, 0x81, 0x17, 0x1e, 0x4c, 0x5a, 0x7a, 0x50, 0xab, 0xa6, 0x16,
0xa9, 0xd8, 0x1c, 0x6d, 0xd3, 0x31, 0xdc, 0xee, 0xb4, 0x21, 0xa1, 0x82, 0xa3, 0x92, 0xd1, 0x5b, 0xe9, 0x0b, 0x68, 0x42, 0x77, 0xb3, 0x2d, 0x97, 0x1b, 0xbf, 0x13, 0x78, 0xe1, 0x70, 0xd2, 0xd2,
0x80, 0x9f, 0x4a, 0x9e, 0xef, 0xec, 0x96, 0x63, 0xb8, 0x9d, 0x69, 0x43, 0x5e, 0xd5, 0x46, 0x9e, 0x50, 0x8b, 0xa3, 0x4a, 0xa3, 0x17, 0x00, 0x3f, 0x90, 0xa2, 0x58, 0xf9, 0xdd, 0xc0, 0x0b, 0xfb,
0xef, 0x7e, 0xf7, 0xd8, 0xee, 0x8b, 0xf7, 0xef, 0xec, 0x4b, 0xc7, 0x70, 0x9b, 0xbf, 0x7a, 0xf0, 0x93, 0x96, 0x3e, 0x68, 0x88, 0xa2, 0x58, 0xfd, 0xf2, 0xb8, 0x5b, 0x97, 0xef, 0xde, 0xfa, 0xfb,
0x92, 0xdd, 0x7d, 0x6b, 0x82, 0x59, 0x0e, 0x4c, 0x2d, 0x68, 0x67, 0x62, 0x26, 0x92, 0x85, 0x20, 0x81, 0x17, 0xb6, 0x7f, 0x7a, 0x88, 0x4a, 0xbb, 0xfc, 0xd6, 0x86, 0x4e, 0xd5, 0x30, 0x1d, 0x40,
0x0d, 0xda, 0x85, 0x4e, 0x90, 0x49, 0xc9, 0x44, 0xb0, 0x24, 0x06, 0x1d, 0x80, 0x35, 0xe1, 0x63, 0x2f, 0x97, 0xd7, 0x52, 0xcd, 0x24, 0x69, 0xd1, 0x21, 0xf4, 0x79, 0xae, 0x35, 0x4a, 0x3e, 0x27,
0x2d, 0x59, 0xc0, 0x84, 0x42, 0x72, 0x41, 0x29, 0xf4, 0x4b, 0x30, 0xf6, 0xe7, 0x49, 0x26, 0xb9, 0x1e, 0x3d, 0x86, 0xc1, 0x95, 0x18, 0x3b, 0x8d, 0x1c, 0xa5, 0x35, 0x64, 0x8f, 0x52, 0x38, 0xaa,
0x62, 0x48, 0x9a, 0xf4, 0x16, 0x9e, 0xc7, 0x0c, 0xd1, 0x9f, 0x30, 0xd4, 0x63, 0x99, 0xc4, 0x3a, 0x84, 0x31, 0x9b, 0xaa, 0x5c, 0x0b, 0x8b, 0x86, 0xb4, 0xe9, 0x05, 0x3c, 0x4d, 0xd1, 0x18, 0x76,
0x48, 0x84, 0xf2, 0x03, 0x85, 0x3a, 0x11, 0xd1, 0x92, 0x98, 0x65, 0x51, 0x2a, 0xd9, 0x98, 0x49, 0x85, 0xc6, 0x8d, 0xb5, 0x4a, 0x1d, 0x57, 0xd2, 0x32, 0x6e, 0x8d, 0x53, 0x32, 0x99, 0x93, 0x4e,
0xc9, 0x42, 0x2d, 0xfc, 0x98, 0x91, 0x16, 0x1d, 0xc2, 0x20, 0x95, 0x6c, 0xce, 0xd9, 0x42, 0xa7, 0x55, 0x94, 0x69, 0x1c, 0xa3, 0xd6, 0x18, 0x3b, 0xc9, 0x52, 0x24, 0x5d, 0x7a, 0x0a, 0xc7, 0x99,
0x92, 0xcf, 0xfd, 0x60, 0x49, 0x2e, 0xe9, 0x0b, 0xb0, 0x53, 0x99, 0x8c, 0x79, 0xc4, 0x74, 0xca, 0xc6, 0xa9, 0xc0, 0x99, 0xcb, 0xb4, 0x98, 0x32, 0x3e, 0x27, 0xfb, 0xf4, 0x19, 0xf8, 0x99, 0x56,
0x03, 0x95, 0x49, 0x86, 0x1a, 0xa7, 0xc9, 0x42, 0xab, 0x84, 0xb4, 0xcb, 0x75, 0xfe, 0xcb, 0xce, 0x63, 0x91, 0xa0, 0xcb, 0x04, 0xb7, 0xb9, 0x46, 0xe3, 0xcc, 0x44, 0xcd, 0x9c, 0x55, 0xa4, 0x57,
0x39, 0xf2, 0x11, 0x8f, 0xb8, 0x5a, 0x92, 0x0e, 0x7d, 0x06, 0x43, 0x64, 0x22, 0xd4, 0xa8, 0x7c, 0x9d, 0xf3, 0x4f, 0x76, 0x2a, 0x8c, 0x18, 0x89, 0x44, 0xd8, 0x39, 0xe9, 0xd3, 0xff, 0xe1, 0xd4,
0x95, 0xa1, 0xce, 0xd2, 0xd0, 0x2f, 0x27, 0xbc, 0x2a, 0xfb, 0xa2, 0xe2, 0xc1, 0x8c, 0x49, 0xd4, 0xa0, 0x8c, 0x9d, 0xb1, 0xcc, 0xe6, 0xc6, 0xe5, 0x59, 0xcc, 0xaa, 0x0e, 0x0f, 0x2a, 0x5f, 0x63,
0xa9, 0x1f, 0xcc, 0x50, 0x73, 0x81, 0xca, 0x8f, 0x22, 0x16, 0x12, 0xa0, 0x37, 0xf0, 0xf4, 0x9f, 0x05, 0xbf, 0x46, 0x6d, 0x5c, 0xc6, 0xf8, 0xb5, 0x71, 0x42, 0x1a, 0xcb, 0x92, 0x04, 0x63, 0x02,
0x6c, 0xca, 0x44, 0xc8, 0xc5, 0x84, 0x58, 0x7f, 0x55, 0xd6, 0xa7, 0xa0, 0xcf, 0x31, 0xe9, 0x52, 0xf4, 0x1c, 0xfe, 0xfb, 0x2b, 0x9b, 0xa1, 0x8c, 0x85, 0xbc, 0x22, 0x83, 0x3f, 0x2a, 0x9b, 0x29,
0x02, 0xdd, 0x90, 0x63, 0x1a, 0xf9, 0xcb, 0x7a, 0x5b, 0x3d, 0xda, 0x86, 0xe6, 0x88, 0x27, 0xa4, 0xb8, 0x5d, 0x4c, 0x86, 0x94, 0xc0, 0x30, 0x16, 0x26, 0x4b, 0xd8, 0xbc, 0xb9, 0xd6, 0x21, 0xed,
0x4f, 0xaf, 0x81, 0xc4, 0x82, 0xc5, 0x89, 0xe0, 0x81, 0x96, 0x2c, 0x4e, 0xe6, 0x2c, 0x24, 0x03, 0x41, 0x7b, 0x24, 0x14, 0x39, 0xa2, 0x67, 0x40, 0x52, 0x89, 0xa9, 0x92, 0x82, 0x3b, 0x8d, 0xa9,
0xfa, 0x04, 0x7a, 0x4c, 0xa0, 0xce, 0x90, 0xc9, 0xb2, 0x00, 0x09, 0x19, 0xb5, 0xa1, 0x55, 0x5f, 0x9a, 0x62, 0x4c, 0x8e, 0xe9, 0x09, 0x1c, 0xa2, 0x34, 0x2e, 0x37, 0xa8, 0xab, 0x02, 0x43, 0x08,
0x5b, 0xef, 0xa3, 0xe5, 0xbd, 0xfe, 0x70, 0x7e, 0x57, 0xab, 0xcb, 0xea, 0xef, 0xed, 0x8f, 0x00, 0x7d, 0x0e, 0x4f, 0x84, 0xe4, 0x49, 0x1e, 0xa3, 0x9b, 0x31, 0xcb, 0x27, 0xd5, 0xcc, 0x1c, 0xe3,
0x00, 0x00, 0xff, 0xff, 0xe0, 0x88, 0x38, 0xbe, 0xa8, 0x02, 0x00, 0x00, 0x5c, 0xe5, 0xd2, 0x92, 0x93, 0x51, 0x0f, 0xba, 0xcd, 0xab, 0x1e, 0x7e, 0x18, 0x44, 0xaf, 0xde,
0xef, 0xbe, 0xdd, 0xcd, 0x7e, 0xbd, 0x7b, 0xf3, 0x3d, 0x00, 0x00, 0xff, 0xff, 0x93, 0x18, 0x16,
0x3f, 0xc7, 0x02, 0x00, 0x00,
} }

View File

@ -32,6 +32,7 @@ message SyncSetting {
BIO = 14; BIO = 14;
MNEMONIC_REMOVED = 15; MNEMONIC_REMOVED = 15;
ENS_USERNAMES = 16; ENS_USERNAMES = 16;
INCLUDE_WATCHONLY_ACCOUNT = 17;
} }
} }

View File

@ -1,19 +1,19 @@
// Code generated by go-bindata. DO NOT EDIT. // Code generated by go-bindata.
// sources: // sources:
// 1593601729_initial_schema.down.sql (144B) // 1593601729_initial_schema.down.sql
// 1593601729_initial_schema.up.sql (1.773kB) // 1593601729_initial_schema.up.sql
// 1597909626_add_server_type.down.sql (0) // 1597909626_add_server_type.down.sql
// 1597909626_add_server_type.up.sql (145B) // 1597909626_add_server_type.up.sql
// 1599053776_add_chat_id_and_type.down.sql (0) // 1599053776_add_chat_id_and_type.down.sql
// 1599053776_add_chat_id_and_type.up.sql (264B) // 1599053776_add_chat_id_and_type.up.sql
// doc.go (382B) // doc.go
// DO NOT EDIT!
package migrations package migrations
import ( import (
"bytes" "bytes"
"compress/gzip" "compress/gzip"
"crypto/sha256"
"fmt" "fmt"
"io" "io"
"io/ioutil" "io/ioutil"
@ -26,7 +26,7 @@ import (
func bindataRead(data []byte, name string) ([]byte, error) { func bindataRead(data []byte, name string) ([]byte, error) {
gz, err := gzip.NewReader(bytes.NewBuffer(data)) gz, err := gzip.NewReader(bytes.NewBuffer(data))
if err != nil { if err != nil {
return nil, fmt.Errorf("read %q: %v", name, err) return nil, fmt.Errorf("Read %q: %v", name, err)
} }
var buf bytes.Buffer var buf bytes.Buffer
@ -34,7 +34,7 @@ func bindataRead(data []byte, name string) ([]byte, error) {
clErr := gz.Close() clErr := gz.Close()
if err != nil { if err != nil {
return nil, fmt.Errorf("read %q: %v", name, err) return nil, fmt.Errorf("Read %q: %v", name, err)
} }
if clErr != nil { if clErr != nil {
return nil, err return nil, err
@ -44,9 +44,8 @@ func bindataRead(data []byte, name string) ([]byte, error) {
} }
type asset struct { type asset struct {
bytes []byte bytes []byte
info os.FileInfo info os.FileInfo
digest [sha256.Size]byte
} }
type bindataFileInfo struct { type bindataFileInfo struct {
@ -90,8 +89,8 @@ func _1593601729_initial_schemaDownSql() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "1593601729_initial_schema.down.sql", size: 144, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "1593601729_initial_schema.down.sql", size: 144, mode: os.FileMode(436), modTime: time.Unix(1687862441, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xa, 0x95, 0x55, 0x64, 0x38, 0x40, 0x16, 0xbf, 0x8b, 0x1c, 0x18, 0xb4, 0xc5, 0x7f, 0xd0, 0xb8, 0xf0, 0x3c, 0xa2, 0x82, 0xf8, 0x8d, 0x5a, 0xd3, 0xb6, 0x6e, 0xa3, 0xb4, 0xc, 0x9, 0x33, 0x0}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -110,8 +109,8 @@ func _1593601729_initial_schemaUpSql() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "1593601729_initial_schema.up.sql", size: 1773, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "1593601729_initial_schema.up.sql", size: 1773, mode: os.FileMode(436), modTime: time.Unix(1687862441, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x4e, 0x1e, 0x5, 0x35, 0x9, 0xb2, 0x2d, 0x6f, 0x33, 0x63, 0xa2, 0x7a, 0x5b, 0xd2, 0x2d, 0xcb, 0x79, 0x7e, 0x6, 0xb4, 0x9d, 0x35, 0xd8, 0x9b, 0x55, 0xe5, 0xf8, 0x44, 0xca, 0xa6, 0xf3, 0xd3}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -130,8 +129,8 @@ func _1597909626_add_server_typeDownSql() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "1597909626_add_server_type.down.sql", size: 0, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "1597909626_add_server_type.down.sql", size: 0, mode: os.FileMode(436), modTime: time.Unix(1687862441, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xe3, 0xb0, 0xc4, 0x42, 0x98, 0xfc, 0x1c, 0x14, 0x9a, 0xfb, 0xf4, 0xc8, 0x99, 0x6f, 0xb9, 0x24, 0x27, 0xae, 0x41, 0xe4, 0x64, 0x9b, 0x93, 0x4c, 0xa4, 0x95, 0x99, 0x1b, 0x78, 0x52, 0xb8, 0x55}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -150,8 +149,8 @@ func _1597909626_add_server_typeUpSql() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "1597909626_add_server_type.up.sql", size: 145, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "1597909626_add_server_type.up.sql", size: 145, mode: os.FileMode(436), modTime: time.Unix(1687862441, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xc8, 0x3f, 0xe0, 0xe7, 0x57, 0x0, 0x5d, 0x60, 0xf3, 0x55, 0x64, 0x71, 0x80, 0x3c, 0xca, 0x8, 0x61, 0xb5, 0x3c, 0xe, 0xa1, 0xe4, 0x61, 0xd1, 0x4e, 0xd8, 0xb2, 0x55, 0xdd, 0x87, 0x62, 0x9b}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -170,8 +169,8 @@ func _1599053776_add_chat_id_and_typeDownSql() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "1599053776_add_chat_id_and_type.down.sql", size: 0, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "1599053776_add_chat_id_and_type.down.sql", size: 0, mode: os.FileMode(436), modTime: time.Unix(1687862441, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xe3, 0xb0, 0xc4, 0x42, 0x98, 0xfc, 0x1c, 0x14, 0x9a, 0xfb, 0xf4, 0xc8, 0x99, 0x6f, 0xb9, 0x24, 0x27, 0xae, 0x41, 0xe4, 0x64, 0x9b, 0x93, 0x4c, 0xa4, 0x95, 0x99, 0x1b, 0x78, 0x52, 0xb8, 0x55}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -190,8 +189,8 @@ func _1599053776_add_chat_id_and_typeUpSql() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "1599053776_add_chat_id_and_type.up.sql", size: 264, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "1599053776_add_chat_id_and_type.up.sql", size: 264, mode: os.FileMode(436), modTime: time.Unix(1687862441, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xea, 0x7a, 0xf9, 0xc4, 0xa2, 0x96, 0x2e, 0xf9, 0x8f, 0x7, 0xf1, 0x1e, 0x73, 0x8a, 0xa6, 0x3a, 0x13, 0x4, 0x73, 0x82, 0x83, 0xb, 0xe3, 0xb5, 0x3b, 0x7e, 0xd, 0x23, 0xce, 0x98, 0xd4, 0xdc}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -210,8 +209,8 @@ func docGo() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "doc.go", size: 382, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "doc.go", size: 382, mode: os.FileMode(436), modTime: time.Unix(1687862441, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xc0, 0x2f, 0x1e, 0x64, 0x9, 0x93, 0xe4, 0x8b, 0xf2, 0x98, 0x5a, 0x45, 0xe2, 0x80, 0x88, 0x67, 0x7a, 0x2d, 0xd7, 0x4b, 0xd1, 0x73, 0xb6, 0x6d, 0x15, 0xc2, 0x0, 0x34, 0xcd, 0xa0, 0xdb, 0x20}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -219,8 +218,8 @@ func docGo() (*asset, error) {
// It returns an error if the asset could not be found or // It returns an error if the asset could not be found or
// could not be loaded. // could not be loaded.
func Asset(name string) ([]byte, error) { func Asset(name string) ([]byte, error) {
canonicalName := strings.Replace(name, "\\", "/", -1) cannonicalName := strings.Replace(name, "\\", "/", -1)
if f, ok := _bindata[canonicalName]; ok { if f, ok := _bindata[cannonicalName]; ok {
a, err := f() a, err := f()
if err != nil { if err != nil {
return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err) return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err)
@ -230,12 +229,6 @@ func Asset(name string) ([]byte, error) {
return nil, fmt.Errorf("Asset %s not found", name) 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. // MustAsset is like Asset but panics when Asset would return an error.
// It simplifies safe initialization of global variables. // It simplifies safe initialization of global variables.
func MustAsset(name string) []byte { func MustAsset(name string) []byte {
@ -247,18 +240,12 @@ func MustAsset(name string) []byte {
return a 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. // AssetInfo loads and returns the asset info for the given name.
// It returns an error if the asset could not be found or // It returns an error if the asset could not be found or
// could not be loaded. // could not be loaded.
func AssetInfo(name string) (os.FileInfo, error) { func AssetInfo(name string) (os.FileInfo, error) {
canonicalName := strings.Replace(name, "\\", "/", -1) cannonicalName := strings.Replace(name, "\\", "/", -1)
if f, ok := _bindata[canonicalName]; ok { if f, ok := _bindata[cannonicalName]; ok {
a, err := f() a, err := f()
if err != nil { if err != nil {
return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err) return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err)
@ -268,33 +255,6 @@ func AssetInfo(name string) (os.FileInfo, error) {
return nil, fmt.Errorf("AssetInfo %s not found", name) 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. // AssetNames returns the names of the assets.
func AssetNames() []string { func AssetNames() []string {
names := make([]string, 0, len(_bindata)) names := make([]string, 0, len(_bindata))
@ -307,17 +267,11 @@ func AssetNames() []string {
// _bindata is a table, holding each asset generator, mapped to its name. // _bindata is a table, holding each asset generator, mapped to its name.
var _bindata = map[string]func() (*asset, error){ var _bindata = map[string]func() (*asset, error){
"1593601729_initial_schema.down.sql": _1593601729_initial_schemaDownSql, "1593601729_initial_schema.down.sql": _1593601729_initial_schemaDownSql,
"1593601729_initial_schema.up.sql": _1593601729_initial_schemaUpSql, "1593601729_initial_schema.up.sql": _1593601729_initial_schemaUpSql,
"1597909626_add_server_type.down.sql": _1597909626_add_server_typeDownSql, "1597909626_add_server_type.down.sql": _1597909626_add_server_typeDownSql,
"1597909626_add_server_type.up.sql": _1597909626_add_server_typeUpSql, "1597909626_add_server_type.up.sql": _1597909626_add_server_typeUpSql,
"1599053776_add_chat_id_and_type.down.sql": _1599053776_add_chat_id_and_typeDownSql, "1599053776_add_chat_id_and_type.down.sql": _1599053776_add_chat_id_and_typeDownSql,
"1599053776_add_chat_id_and_type.up.sql": _1599053776_add_chat_id_and_typeUpSql, "1599053776_add_chat_id_and_type.up.sql": _1599053776_add_chat_id_and_typeUpSql,
"doc.go": docGo, "doc.go": docGo,
} }
@ -330,15 +284,15 @@ var _bindata = map[string]func() (*asset, error){
// img/ // img/
// a.png // a.png
// b.png // b.png
// then AssetDir("data") would return []string{"foo.txt", "img"}, // then AssetDir("data") would return []string{"foo.txt", "img"}
// AssetDir("data/img") would return []string{"a.png", "b.png"}, // AssetDir("data/img") would return []string{"a.png", "b.png"}
// AssetDir("foo.txt") and AssetDir("notexist") would return an error, and // AssetDir("foo.txt") and AssetDir("notexist") would return an error
// AssetDir("") will return []string{"data"}. // AssetDir("") will return []string{"data"}.
func AssetDir(name string) ([]string, error) { func AssetDir(name string) ([]string, error) {
node := _bintree node := _bintree
if len(name) != 0 { if len(name) != 0 {
canonicalName := strings.Replace(name, "\\", "/", -1) cannonicalName := strings.Replace(name, "\\", "/", -1)
pathList := strings.Split(canonicalName, "/") pathList := strings.Split(cannonicalName, "/")
for _, p := range pathList { for _, p := range pathList {
node = node.Children[p] node = node.Children[p]
if node == nil { if node == nil {
@ -360,18 +314,17 @@ type bintree struct {
Func func() (*asset, error) Func func() (*asset, error)
Children map[string]*bintree Children map[string]*bintree
} }
var _bintree = &bintree{nil, map[string]*bintree{ var _bintree = &bintree{nil, map[string]*bintree{
"1593601729_initial_schema.down.sql": &bintree{_1593601729_initial_schemaDownSql, map[string]*bintree{}}, "1593601729_initial_schema.down.sql": &bintree{_1593601729_initial_schemaDownSql, map[string]*bintree{}},
"1593601729_initial_schema.up.sql": &bintree{_1593601729_initial_schemaUpSql, map[string]*bintree{}}, "1593601729_initial_schema.up.sql": &bintree{_1593601729_initial_schemaUpSql, map[string]*bintree{}},
"1597909626_add_server_type.down.sql": &bintree{_1597909626_add_server_typeDownSql, map[string]*bintree{}}, "1597909626_add_server_type.down.sql": &bintree{_1597909626_add_server_typeDownSql, map[string]*bintree{}},
"1597909626_add_server_type.up.sql": &bintree{_1597909626_add_server_typeUpSql, map[string]*bintree{}}, "1597909626_add_server_type.up.sql": &bintree{_1597909626_add_server_typeUpSql, map[string]*bintree{}},
"1599053776_add_chat_id_and_type.down.sql": &bintree{_1599053776_add_chat_id_and_typeDownSql, map[string]*bintree{}}, "1599053776_add_chat_id_and_type.down.sql": &bintree{_1599053776_add_chat_id_and_typeDownSql, map[string]*bintree{}},
"1599053776_add_chat_id_and_type.up.sql": &bintree{_1599053776_add_chat_id_and_typeUpSql, map[string]*bintree{}}, "1599053776_add_chat_id_and_type.up.sql": &bintree{_1599053776_add_chat_id_and_typeUpSql, map[string]*bintree{}},
"doc.go": &bintree{docGo, map[string]*bintree{}}, "doc.go": &bintree{docGo, map[string]*bintree{}},
}} }}
// RestoreAsset restores an asset under the given directory. // RestoreAsset restores an asset under the given directory
func RestoreAsset(dir, name string) error { func RestoreAsset(dir, name string) error {
data, err := Asset(name) data, err := Asset(name)
if err != nil { if err != nil {
@ -389,10 +342,14 @@ func RestoreAsset(dir, name string) error {
if err != nil { if err != nil {
return err return err
} }
return os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime()) 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. // RestoreAssets restores an asset under the given directory recursively
func RestoreAssets(dir, name string) error { func RestoreAssets(dir, name string) error {
children, err := AssetDir(name) children, err := AssetDir(name)
// File // File
@ -410,6 +367,7 @@ func RestoreAssets(dir, name string) error {
} }
func _filePath(dir, name string) string { func _filePath(dir, name string) string {
canonicalName := strings.Replace(name, "\\", "/", -1) cannonicalName := strings.Replace(name, "\\", "/", -1)
return filepath.Join(append([]string{dir}, strings.Split(canonicalName, "/")...)...) return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...)
} }

View File

@ -1,17 +1,17 @@
// Code generated by go-bindata. DO NOT EDIT. // Code generated by go-bindata.
// sources: // sources:
// 1593601728_initial_schema.down.sql (200B) // 1593601728_initial_schema.down.sql
// 1593601728_initial_schema.up.sql (675B) // 1593601728_initial_schema.up.sql
// 1598419937_add_push_notifications_table.down.sql (51B) // 1598419937_add_push_notifications_table.down.sql
// 1598419937_add_push_notifications_table.up.sql (104B) // 1598419937_add_push_notifications_table.up.sql
// doc.go (382B) // doc.go
// DO NOT EDIT!
package migrations package migrations
import ( import (
"bytes" "bytes"
"compress/gzip" "compress/gzip"
"crypto/sha256"
"fmt" "fmt"
"io" "io"
"io/ioutil" "io/ioutil"
@ -24,7 +24,7 @@ import (
func bindataRead(data []byte, name string) ([]byte, error) { func bindataRead(data []byte, name string) ([]byte, error) {
gz, err := gzip.NewReader(bytes.NewBuffer(data)) gz, err := gzip.NewReader(bytes.NewBuffer(data))
if err != nil { if err != nil {
return nil, fmt.Errorf("read %q: %v", name, err) return nil, fmt.Errorf("Read %q: %v", name, err)
} }
var buf bytes.Buffer var buf bytes.Buffer
@ -32,7 +32,7 @@ func bindataRead(data []byte, name string) ([]byte, error) {
clErr := gz.Close() clErr := gz.Close()
if err != nil { if err != nil {
return nil, fmt.Errorf("read %q: %v", name, err) return nil, fmt.Errorf("Read %q: %v", name, err)
} }
if clErr != nil { if clErr != nil {
return nil, err return nil, err
@ -42,9 +42,8 @@ func bindataRead(data []byte, name string) ([]byte, error) {
} }
type asset struct { type asset struct {
bytes []byte bytes []byte
info os.FileInfo info os.FileInfo
digest [sha256.Size]byte
} }
type bindataFileInfo struct { type bindataFileInfo struct {
@ -88,8 +87,8 @@ func _1593601728_initial_schemaDownSql() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "1593601728_initial_schema.down.sql", size: 200, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "1593601728_initial_schema.down.sql", size: 200, mode: os.FileMode(436), modTime: time.Unix(1687862441, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x88, 0x8a, 0x61, 0x81, 0x57, 0x45, 0x9b, 0x97, 0x9b, 0x1f, 0xf6, 0x94, 0x8a, 0x20, 0xb3, 0x2b, 0xff, 0x69, 0x49, 0xf4, 0x58, 0xcc, 0xd0, 0x55, 0xcc, 0x9a, 0x8b, 0xb6, 0x7f, 0x29, 0x53, 0xc1}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -108,8 +107,8 @@ func _1593601728_initial_schemaUpSql() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "1593601728_initial_schema.up.sql", size: 675, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "1593601728_initial_schema.up.sql", size: 675, mode: os.FileMode(436), modTime: time.Unix(1687862441, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xfd, 0x61, 0x90, 0x79, 0xd9, 0x14, 0x65, 0xe9, 0x96, 0x53, 0x17, 0x33, 0x54, 0xeb, 0x8b, 0x5d, 0x95, 0x99, 0x10, 0x36, 0x58, 0xdd, 0xb2, 0xbf, 0x45, 0xd9, 0xbb, 0xc4, 0x92, 0xe, 0xce, 0x2}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -128,8 +127,8 @@ func _1598419937_add_push_notifications_tableDownSql() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "1598419937_add_push_notifications_table.down.sql", size: 51, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "1598419937_add_push_notifications_table.down.sql", size: 51, mode: os.FileMode(436), modTime: time.Unix(1687862441, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xc, 0x98, 0xc8, 0x30, 0x45, 0x5b, 0xc5, 0x7d, 0x13, 0x5d, 0xe7, 0xc8, 0x23, 0x43, 0xf7, 0xdc, 0x9c, 0xe2, 0xdd, 0x63, 0xf0, 0xb7, 0x16, 0x40, 0xc, 0xda, 0xb9, 0x16, 0x70, 0x2b, 0x5a, 0x7e}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -148,8 +147,8 @@ func _1598419937_add_push_notifications_tableUpSql() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "1598419937_add_push_notifications_table.up.sql", size: 104, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "1598419937_add_push_notifications_table.up.sql", size: 104, mode: os.FileMode(436), modTime: time.Unix(1687862441, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x2, 0x3e, 0xef, 0xf, 0xc2, 0xdf, 0xbc, 0x99, 0x7a, 0xc2, 0xd3, 0x64, 0x4f, 0x4c, 0x7e, 0xfc, 0x2e, 0x8c, 0xa7, 0x54, 0xd3, 0x4d, 0x25, 0x98, 0x41, 0xbc, 0xea, 0xd7, 0x2, 0xc1, 0xd0, 0x52}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -168,8 +167,8 @@ func docGo() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "doc.go", size: 382, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "doc.go", size: 382, mode: os.FileMode(436), modTime: time.Unix(1687862441, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xc0, 0x2f, 0x1e, 0x64, 0x9, 0x93, 0xe4, 0x8b, 0xf2, 0x98, 0x5a, 0x45, 0xe2, 0x80, 0x88, 0x67, 0x7a, 0x2d, 0xd7, 0x4b, 0xd1, 0x73, 0xb6, 0x6d, 0x15, 0xc2, 0x0, 0x34, 0xcd, 0xa0, 0xdb, 0x20}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -177,8 +176,8 @@ func docGo() (*asset, error) {
// It returns an error if the asset could not be found or // It returns an error if the asset could not be found or
// could not be loaded. // could not be loaded.
func Asset(name string) ([]byte, error) { func Asset(name string) ([]byte, error) {
canonicalName := strings.Replace(name, "\\", "/", -1) cannonicalName := strings.Replace(name, "\\", "/", -1)
if f, ok := _bindata[canonicalName]; ok { if f, ok := _bindata[cannonicalName]; ok {
a, err := f() a, err := f()
if err != nil { if err != nil {
return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err) return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err)
@ -188,12 +187,6 @@ func Asset(name string) ([]byte, error) {
return nil, fmt.Errorf("Asset %s not found", name) 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. // MustAsset is like Asset but panics when Asset would return an error.
// It simplifies safe initialization of global variables. // It simplifies safe initialization of global variables.
func MustAsset(name string) []byte { func MustAsset(name string) []byte {
@ -205,18 +198,12 @@ func MustAsset(name string) []byte {
return a 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. // AssetInfo loads and returns the asset info for the given name.
// It returns an error if the asset could not be found or // It returns an error if the asset could not be found or
// could not be loaded. // could not be loaded.
func AssetInfo(name string) (os.FileInfo, error) { func AssetInfo(name string) (os.FileInfo, error) {
canonicalName := strings.Replace(name, "\\", "/", -1) cannonicalName := strings.Replace(name, "\\", "/", -1)
if f, ok := _bindata[canonicalName]; ok { if f, ok := _bindata[cannonicalName]; ok {
a, err := f() a, err := f()
if err != nil { if err != nil {
return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err) return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err)
@ -226,33 +213,6 @@ func AssetInfo(name string) (os.FileInfo, error) {
return nil, fmt.Errorf("AssetInfo %s not found", name) 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. // AssetNames returns the names of the assets.
func AssetNames() []string { func AssetNames() []string {
names := make([]string, 0, len(_bindata)) names := make([]string, 0, len(_bindata))
@ -265,13 +225,9 @@ func AssetNames() []string {
// _bindata is a table, holding each asset generator, mapped to its name. // _bindata is a table, holding each asset generator, mapped to its name.
var _bindata = map[string]func() (*asset, error){ var _bindata = map[string]func() (*asset, error){
"1593601728_initial_schema.down.sql": _1593601728_initial_schemaDownSql, "1593601728_initial_schema.down.sql": _1593601728_initial_schemaDownSql,
"1593601728_initial_schema.up.sql": _1593601728_initial_schemaUpSql, "1593601728_initial_schema.up.sql": _1593601728_initial_schemaUpSql,
"1598419937_add_push_notifications_table.down.sql": _1598419937_add_push_notifications_tableDownSql, "1598419937_add_push_notifications_table.down.sql": _1598419937_add_push_notifications_tableDownSql,
"1598419937_add_push_notifications_table.up.sql": _1598419937_add_push_notifications_tableUpSql, "1598419937_add_push_notifications_table.up.sql": _1598419937_add_push_notifications_tableUpSql,
"doc.go": docGo, "doc.go": docGo,
} }
@ -284,15 +240,15 @@ var _bindata = map[string]func() (*asset, error){
// img/ // img/
// a.png // a.png
// b.png // b.png
// then AssetDir("data") would return []string{"foo.txt", "img"}, // then AssetDir("data") would return []string{"foo.txt", "img"}
// AssetDir("data/img") would return []string{"a.png", "b.png"}, // AssetDir("data/img") would return []string{"a.png", "b.png"}
// AssetDir("foo.txt") and AssetDir("notexist") would return an error, and // AssetDir("foo.txt") and AssetDir("notexist") would return an error
// AssetDir("") will return []string{"data"}. // AssetDir("") will return []string{"data"}.
func AssetDir(name string) ([]string, error) { func AssetDir(name string) ([]string, error) {
node := _bintree node := _bintree
if len(name) != 0 { if len(name) != 0 {
canonicalName := strings.Replace(name, "\\", "/", -1) cannonicalName := strings.Replace(name, "\\", "/", -1)
pathList := strings.Split(canonicalName, "/") pathList := strings.Split(cannonicalName, "/")
for _, p := range pathList { for _, p := range pathList {
node = node.Children[p] node = node.Children[p]
if node == nil { if node == nil {
@ -314,16 +270,15 @@ type bintree struct {
Func func() (*asset, error) Func func() (*asset, error)
Children map[string]*bintree Children map[string]*bintree
} }
var _bintree = &bintree{nil, map[string]*bintree{ var _bintree = &bintree{nil, map[string]*bintree{
"1593601728_initial_schema.down.sql": &bintree{_1593601728_initial_schemaDownSql, map[string]*bintree{}}, "1593601728_initial_schema.down.sql": &bintree{_1593601728_initial_schemaDownSql, map[string]*bintree{}},
"1593601728_initial_schema.up.sql": &bintree{_1593601728_initial_schemaUpSql, map[string]*bintree{}}, "1593601728_initial_schema.up.sql": &bintree{_1593601728_initial_schemaUpSql, map[string]*bintree{}},
"1598419937_add_push_notifications_table.down.sql": &bintree{_1598419937_add_push_notifications_tableDownSql, map[string]*bintree{}}, "1598419937_add_push_notifications_table.down.sql": &bintree{_1598419937_add_push_notifications_tableDownSql, map[string]*bintree{}},
"1598419937_add_push_notifications_table.up.sql": &bintree{_1598419937_add_push_notifications_tableUpSql, map[string]*bintree{}}, "1598419937_add_push_notifications_table.up.sql": &bintree{_1598419937_add_push_notifications_tableUpSql, map[string]*bintree{}},
"doc.go": &bintree{docGo, map[string]*bintree{}}, "doc.go": &bintree{docGo, map[string]*bintree{}},
}} }}
// RestoreAsset restores an asset under the given directory. // RestoreAsset restores an asset under the given directory
func RestoreAsset(dir, name string) error { func RestoreAsset(dir, name string) error {
data, err := Asset(name) data, err := Asset(name)
if err != nil { if err != nil {
@ -341,10 +296,14 @@ func RestoreAsset(dir, name string) error {
if err != nil { if err != nil {
return err return err
} }
return os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime()) 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. // RestoreAssets restores an asset under the given directory recursively
func RestoreAssets(dir, name string) error { func RestoreAssets(dir, name string) error {
children, err := AssetDir(name) children, err := AssetDir(name)
// File // File
@ -362,6 +321,7 @@ func RestoreAssets(dir, name string) error {
} }
func _filePath(dir, name string) string { func _filePath(dir, name string) string {
canonicalName := strings.Replace(name, "\\", "/", -1) cannonicalName := strings.Replace(name, "\\", "/", -1)
return filepath.Join(append([]string{dir}, strings.Split(canonicalName, "/")...)...) return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...)
} }

View File

@ -1,18 +1,18 @@
// Code generated by go-bindata. DO NOT EDIT. // Code generated by go-bindata.
// sources: // sources:
// 1561059284_add_waku_keys.down.sql (22B) // 1561059284_add_waku_keys.down.sql
// 1561059284_add_waku_keys.up.sql (109B) // 1561059284_add_waku_keys.up.sql
// 1616691080_add_wakuV2_keys.down.sql (24B) // 1616691080_add_wakuV2_keys.down.sql
// 1616691080_add_wakuV2_keys.up.sql (111B) // 1616691080_add_wakuV2_keys.up.sql
// 1634723014_add_wakuV2_keys.up.sql (125B) // 1634723014_add_wakuV2_keys.up.sql
// doc.go (373B) // doc.go
// DO NOT EDIT!
package sqlite package sqlite
import ( import (
"bytes" "bytes"
"compress/gzip" "compress/gzip"
"crypto/sha256"
"fmt" "fmt"
"io" "io"
"io/ioutil" "io/ioutil"
@ -25,7 +25,7 @@ import (
func bindataRead(data []byte, name string) ([]byte, error) { func bindataRead(data []byte, name string) ([]byte, error) {
gz, err := gzip.NewReader(bytes.NewBuffer(data)) gz, err := gzip.NewReader(bytes.NewBuffer(data))
if err != nil { if err != nil {
return nil, fmt.Errorf("read %q: %v", name, err) return nil, fmt.Errorf("Read %q: %v", name, err)
} }
var buf bytes.Buffer var buf bytes.Buffer
@ -33,7 +33,7 @@ func bindataRead(data []byte, name string) ([]byte, error) {
clErr := gz.Close() clErr := gz.Close()
if err != nil { if err != nil {
return nil, fmt.Errorf("read %q: %v", name, err) return nil, fmt.Errorf("Read %q: %v", name, err)
} }
if clErr != nil { if clErr != nil {
return nil, err return nil, err
@ -43,9 +43,8 @@ func bindataRead(data []byte, name string) ([]byte, error) {
} }
type asset struct { type asset struct {
bytes []byte bytes []byte
info os.FileInfo info os.FileInfo
digest [sha256.Size]byte
} }
type bindataFileInfo struct { type bindataFileInfo struct {
@ -89,8 +88,8 @@ func _1561059284_add_waku_keysDownSql() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "1561059284_add_waku_keys.down.sql", size: 22, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "1561059284_add_waku_keys.down.sql", size: 22, mode: os.FileMode(436), modTime: time.Unix(1687862441, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xe5, 0x2a, 0x7e, 0x9, 0xa3, 0xdd, 0xc6, 0x3, 0xfa, 0xaa, 0x98, 0xa0, 0x26, 0x5e, 0x67, 0x43, 0xe6, 0x20, 0xfd, 0x10, 0xfd, 0x60, 0x89, 0x17, 0x13, 0x87, 0x1b, 0x44, 0x36, 0x79, 0xb6, 0x60}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -109,8 +108,8 @@ func _1561059284_add_waku_keysUpSql() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "1561059284_add_waku_keys.up.sql", size: 109, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "1561059284_add_waku_keys.up.sql", size: 109, mode: os.FileMode(436), modTime: time.Unix(1687862441, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xa9, 0x5c, 0x8, 0x32, 0xef, 0x12, 0x88, 0x21, 0xd, 0x7a, 0x42, 0x4d, 0xe7, 0x2d, 0x6c, 0x99, 0xb6, 0x1, 0xf1, 0xba, 0x2c, 0x40, 0x8d, 0xa9, 0x4b, 0xe6, 0xc4, 0x21, 0xec, 0x47, 0x6b, 0xf7}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -129,8 +128,8 @@ func _1616691080_add_wakuv2_keysDownSql() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "1616691080_add_wakuV2_keys.down.sql", size: 24, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "1616691080_add_wakuV2_keys.down.sql", size: 24, mode: os.FileMode(436), modTime: time.Unix(1687862441, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x42, 0xb6, 0x23, 0x70, 0xb8, 0x63, 0x18, 0x61, 0xea, 0x35, 0x6e, 0xae, 0xe9, 0x71, 0x89, 0xa, 0xa5, 0x72, 0xa2, 0x64, 0xaa, 0x45, 0x1, 0xf, 0xfc, 0xee, 0x1b, 0xd9, 0xd2, 0x27, 0xf4, 0xe2}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -149,8 +148,8 @@ func _1616691080_add_wakuv2_keysUpSql() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "1616691080_add_wakuV2_keys.up.sql", size: 111, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "1616691080_add_wakuV2_keys.up.sql", size: 111, mode: os.FileMode(436), modTime: time.Unix(1687862441, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x10, 0xf0, 0x97, 0x25, 0xfe, 0x96, 0x2c, 0xa8, 0x62, 0x4a, 0x71, 0x75, 0xff, 0x5f, 0x43, 0x1e, 0x71, 0x53, 0xf1, 0xde, 0xf, 0xcf, 0xcd, 0x87, 0x15, 0x61, 0x9d, 0x25, 0x2e, 0xaf, 0x18, 0x99}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -169,8 +168,8 @@ func _1634723014_add_wakuv2_keysUpSql() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "1634723014_add_wakuV2_keys.up.sql", size: 125, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "1634723014_add_wakuV2_keys.up.sql", size: 125, mode: os.FileMode(436), modTime: time.Unix(1687862441, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x7e, 0xe1, 0x7a, 0x1e, 0x6, 0xad, 0x1b, 0x37, 0xdb, 0xea, 0x94, 0xaf, 0xe0, 0x7d, 0xc9, 0xd6, 0xda, 0x52, 0x71, 0x8a, 0x44, 0xb3, 0xa6, 0x7b, 0x1e, 0x90, 0xdb, 0x1e, 0x5a, 0xa, 0x40, 0x26}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -189,8 +188,8 @@ func docGo() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "doc.go", size: 373, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "doc.go", size: 373, mode: os.FileMode(436), modTime: time.Unix(1687862441, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x23, 0x6a, 0xc1, 0xce, 0x94, 0xf6, 0xef, 0xf1, 0x97, 0x95, 0xb, 0x35, 0xaf, 0x5f, 0xe7, 0x5f, 0xac, 0x6e, 0xb8, 0xab, 0xba, 0xb5, 0x35, 0x97, 0x22, 0x36, 0x11, 0xce, 0x44, 0xfc, 0xfa, 0xac}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -198,8 +197,8 @@ func docGo() (*asset, error) {
// It returns an error if the asset could not be found or // It returns an error if the asset could not be found or
// could not be loaded. // could not be loaded.
func Asset(name string) ([]byte, error) { func Asset(name string) ([]byte, error) {
canonicalName := strings.Replace(name, "\\", "/", -1) cannonicalName := strings.Replace(name, "\\", "/", -1)
if f, ok := _bindata[canonicalName]; ok { if f, ok := _bindata[cannonicalName]; ok {
a, err := f() a, err := f()
if err != nil { if err != nil {
return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err) return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err)
@ -209,12 +208,6 @@ func Asset(name string) ([]byte, error) {
return nil, fmt.Errorf("Asset %s not found", name) 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. // MustAsset is like Asset but panics when Asset would return an error.
// It simplifies safe initialization of global variables. // It simplifies safe initialization of global variables.
func MustAsset(name string) []byte { func MustAsset(name string) []byte {
@ -226,18 +219,12 @@ func MustAsset(name string) []byte {
return a 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. // AssetInfo loads and returns the asset info for the given name.
// It returns an error if the asset could not be found or // It returns an error if the asset could not be found or
// could not be loaded. // could not be loaded.
func AssetInfo(name string) (os.FileInfo, error) { func AssetInfo(name string) (os.FileInfo, error) {
canonicalName := strings.Replace(name, "\\", "/", -1) cannonicalName := strings.Replace(name, "\\", "/", -1)
if f, ok := _bindata[canonicalName]; ok { if f, ok := _bindata[cannonicalName]; ok {
a, err := f() a, err := f()
if err != nil { if err != nil {
return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err) return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err)
@ -247,33 +234,6 @@ func AssetInfo(name string) (os.FileInfo, error) {
return nil, fmt.Errorf("AssetInfo %s not found", name) 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. // AssetNames returns the names of the assets.
func AssetNames() []string { func AssetNames() []string {
names := make([]string, 0, len(_bindata)) names := make([]string, 0, len(_bindata))
@ -286,15 +246,10 @@ func AssetNames() []string {
// _bindata is a table, holding each asset generator, mapped to its name. // _bindata is a table, holding each asset generator, mapped to its name.
var _bindata = map[string]func() (*asset, error){ var _bindata = map[string]func() (*asset, error){
"1561059284_add_waku_keys.down.sql": _1561059284_add_waku_keysDownSql, "1561059284_add_waku_keys.down.sql": _1561059284_add_waku_keysDownSql,
"1561059284_add_waku_keys.up.sql": _1561059284_add_waku_keysUpSql, "1561059284_add_waku_keys.up.sql": _1561059284_add_waku_keysUpSql,
"1616691080_add_wakuV2_keys.down.sql": _1616691080_add_wakuv2_keysDownSql, "1616691080_add_wakuV2_keys.down.sql": _1616691080_add_wakuv2_keysDownSql,
"1616691080_add_wakuV2_keys.up.sql": _1616691080_add_wakuv2_keysUpSql, "1616691080_add_wakuV2_keys.up.sql": _1616691080_add_wakuv2_keysUpSql,
"1634723014_add_wakuV2_keys.up.sql": _1634723014_add_wakuv2_keysUpSql, "1634723014_add_wakuV2_keys.up.sql": _1634723014_add_wakuv2_keysUpSql,
"doc.go": docGo, "doc.go": docGo,
} }
@ -307,15 +262,15 @@ var _bindata = map[string]func() (*asset, error){
// img/ // img/
// a.png // a.png
// b.png // b.png
// then AssetDir("data") would return []string{"foo.txt", "img"}, // then AssetDir("data") would return []string{"foo.txt", "img"}
// AssetDir("data/img") would return []string{"a.png", "b.png"}, // AssetDir("data/img") would return []string{"a.png", "b.png"}
// AssetDir("foo.txt") and AssetDir("notexist") would return an error, and // AssetDir("foo.txt") and AssetDir("notexist") would return an error
// AssetDir("") will return []string{"data"}. // AssetDir("") will return []string{"data"}.
func AssetDir(name string) ([]string, error) { func AssetDir(name string) ([]string, error) {
node := _bintree node := _bintree
if len(name) != 0 { if len(name) != 0 {
canonicalName := strings.Replace(name, "\\", "/", -1) cannonicalName := strings.Replace(name, "\\", "/", -1)
pathList := strings.Split(canonicalName, "/") pathList := strings.Split(cannonicalName, "/")
for _, p := range pathList { for _, p := range pathList {
node = node.Children[p] node = node.Children[p]
if node == nil { if node == nil {
@ -337,17 +292,16 @@ type bintree struct {
Func func() (*asset, error) Func func() (*asset, error)
Children map[string]*bintree Children map[string]*bintree
} }
var _bintree = &bintree{nil, map[string]*bintree{ var _bintree = &bintree{nil, map[string]*bintree{
"1561059284_add_waku_keys.down.sql": &bintree{_1561059284_add_waku_keysDownSql, map[string]*bintree{}}, "1561059284_add_waku_keys.down.sql": &bintree{_1561059284_add_waku_keysDownSql, map[string]*bintree{}},
"1561059284_add_waku_keys.up.sql": &bintree{_1561059284_add_waku_keysUpSql, map[string]*bintree{}}, "1561059284_add_waku_keys.up.sql": &bintree{_1561059284_add_waku_keysUpSql, map[string]*bintree{}},
"1616691080_add_wakuV2_keys.down.sql": &bintree{_1616691080_add_wakuv2_keysDownSql, map[string]*bintree{}}, "1616691080_add_wakuV2_keys.down.sql": &bintree{_1616691080_add_wakuv2_keysDownSql, map[string]*bintree{}},
"1616691080_add_wakuV2_keys.up.sql": &bintree{_1616691080_add_wakuv2_keysUpSql, map[string]*bintree{}}, "1616691080_add_wakuV2_keys.up.sql": &bintree{_1616691080_add_wakuv2_keysUpSql, map[string]*bintree{}},
"1634723014_add_wakuV2_keys.up.sql": &bintree{_1634723014_add_wakuv2_keysUpSql, map[string]*bintree{}}, "1634723014_add_wakuV2_keys.up.sql": &bintree{_1634723014_add_wakuv2_keysUpSql, map[string]*bintree{}},
"doc.go": &bintree{docGo, map[string]*bintree{}}, "doc.go": &bintree{docGo, map[string]*bintree{}},
}} }}
// RestoreAsset restores an asset under the given directory. // RestoreAsset restores an asset under the given directory
func RestoreAsset(dir, name string) error { func RestoreAsset(dir, name string) error {
data, err := Asset(name) data, err := Asset(name)
if err != nil { if err != nil {
@ -365,10 +319,14 @@ func RestoreAsset(dir, name string) error {
if err != nil { if err != nil {
return err return err
} }
return os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime()) 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. // RestoreAssets restores an asset under the given directory recursively
func RestoreAssets(dir, name string) error { func RestoreAssets(dir, name string) error {
children, err := AssetDir(name) children, err := AssetDir(name)
// File // File
@ -386,6 +344,7 @@ func RestoreAssets(dir, name string) error {
} }
func _filePath(dir, name string) string { func _filePath(dir, name string) string {
canonicalName := strings.Replace(name, "\\", "/", -1) cannonicalName := strings.Replace(name, "\\", "/", -1)
return filepath.Join(append([]string{dir}, strings.Split(canonicalName, "/")...)...) return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...)
} }

View File

@ -1,32 +1,32 @@
// Code generated by go-bindata. DO NOT EDIT. // Code generated by go-bindata.
// sources: // sources:
// emojis.txt (28.134kB) // emojis.txt
// ../config/README.md (3.031kB) // ../config/README.md
// ../config/cli/anon-metric-node-client.json (857B) // ../config/cli/anon-metric-node-client.json
// ../config/cli/anon-metric-node-server.json (696B) // ../config/cli/anon-metric-node-server.json
// ../config/cli/fleet-eth.prod.json (3.619kB) // ../config/cli/fleet-eth.prod.json
// ../config/cli/fleet-eth.staging.json (2.139kB) // ../config/cli/fleet-eth.staging.json
// ../config/cli/fleet-status.prod.json (2.338kB) // ../config/cli/fleet-status.prod.json
// ../config/cli/fleet-status.test.json (1.457kB) // ../config/cli/fleet-status.test.json
// ../config/cli/fleet-wakuv2.prod.json (1.264kB) // ../config/cli/fleet-wakuv2.prod.json
// ../config/cli/fleet-wakuv2.test.json (1.264kB) // ../config/cli/fleet-wakuv2.test.json
// ../config/cli/les-enabled.json (58B) // ../config/cli/les-enabled.json
// ../config/cli/mailserver-enabled.json (176B) // ../config/cli/mailserver-enabled.json
// ../config/status-chain-genesis.json (612B) // ../config/status-chain-genesis.json
// keys/bootnode.key (65B) // keys/bootnode.key
// keys/firebaseauthkey (153B) // keys/firebaseauthkey
// keys/test-account1-status-chain.pk (489B) // keys/test-account1-status-chain.pk
// keys/test-account1.pk (491B) // keys/test-account1.pk
// keys/test-account2-status-chain.pk (489B) // keys/test-account2-status-chain.pk
// keys/test-account2.pk (491B) // keys/test-account2.pk
// keys/test-account3-before-eip55.pk (489B) // keys/test-account3-before-eip55.pk
// DO NOT EDIT!
package static package static
import ( import (
"bytes" "bytes"
"compress/gzip" "compress/gzip"
"crypto/sha256"
"fmt" "fmt"
"io" "io"
"io/ioutil" "io/ioutil"
@ -39,7 +39,7 @@ import (
func bindataRead(data []byte, name string) ([]byte, error) { func bindataRead(data []byte, name string) ([]byte, error) {
gz, err := gzip.NewReader(bytes.NewBuffer(data)) gz, err := gzip.NewReader(bytes.NewBuffer(data))
if err != nil { if err != nil {
return nil, fmt.Errorf("read %q: %v", name, err) return nil, fmt.Errorf("Read %q: %v", name, err)
} }
var buf bytes.Buffer var buf bytes.Buffer
@ -47,7 +47,7 @@ func bindataRead(data []byte, name string) ([]byte, error) {
clErr := gz.Close() clErr := gz.Close()
if err != nil { if err != nil {
return nil, fmt.Errorf("read %q: %v", name, err) return nil, fmt.Errorf("Read %q: %v", name, err)
} }
if clErr != nil { if clErr != nil {
return nil, err return nil, err
@ -57,9 +57,8 @@ func bindataRead(data []byte, name string) ([]byte, error) {
} }
type asset struct { type asset struct {
bytes []byte bytes []byte
info os.FileInfo info os.FileInfo
digest [sha256.Size]byte
} }
type bindataFileInfo struct { type bindataFileInfo struct {
@ -103,8 +102,8 @@ func emojisTxt() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "emojis.txt", size: 28134, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "emojis.txt", size: 28134, mode: os.FileMode(436), modTime: time.Unix(1687862442, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xf5, 0x28, 0xc, 0x22, 0x34, 0xa1, 0xeb, 0x8, 0x8d, 0xef, 0x38, 0x1b, 0xd8, 0xc2, 0x1a, 0x6d, 0xa2, 0x62, 0xad, 0x43, 0xfc, 0x1c, 0x38, 0xda, 0x8c, 0x3f, 0x34, 0xa, 0x8c, 0x6f, 0x5d, 0xd8}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -123,8 +122,8 @@ func ConfigReadmeMd() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "../config/README.md", size: 3031, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "../config/README.md", size: 3031, mode: os.FileMode(436), modTime: time.Unix(1687862441, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x15, 0x44, 0x2b, 0x13, 0x14, 0x34, 0xa, 0x66, 0x62, 0x1b, 0xc6, 0x4a, 0x2c, 0x7d, 0x4d, 0x89, 0xfb, 0xc9, 0x69, 0xe4, 0x18, 0x5f, 0x3, 0x98, 0x6d, 0x3c, 0x9e, 0xa8, 0xcd, 0x53, 0x5d, 0x75}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -143,8 +142,8 @@ func ConfigCliAnonMetricNodeClientJson() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "../config/cli/anon-metric-node-client.json", size: 857, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "../config/cli/anon-metric-node-client.json", size: 857, mode: os.FileMode(436), modTime: time.Unix(1687862441, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x90, 0xdf, 0xcd, 0xc8, 0x92, 0x1d, 0x63, 0x5e, 0xe1, 0xf9, 0x7f, 0xed, 0xf2, 0x68, 0x6b, 0x20, 0xff, 0x1d, 0x3b, 0xc9, 0x7b, 0xb9, 0x6a, 0xba, 0xd3, 0xbd, 0xf7, 0x48, 0x7b, 0x5a, 0x52, 0x79}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -163,8 +162,8 @@ func ConfigCliAnonMetricNodeServerJson() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "../config/cli/anon-metric-node-server.json", size: 696, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "../config/cli/anon-metric-node-server.json", size: 696, mode: os.FileMode(436), modTime: time.Unix(1687862441, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xf0, 0x2f, 0x97, 0xab, 0x77, 0x61, 0x93, 0x9d, 0x1f, 0x33, 0x18, 0x72, 0xad, 0xce, 0xa3, 0x35, 0xa9, 0x44, 0xbf, 0x29, 0xa8, 0xea, 0x21, 0xb7, 0x22, 0x7f, 0x7d, 0x3a, 0x6b, 0x55, 0x3c, 0x66}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -183,8 +182,8 @@ func ConfigCliFleetEthProdJson() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "../config/cli/fleet-eth.prod.json", size: 3619, mode: os.FileMode(0664), modTime: time.Unix(1686055892, 0)} info := bindataFileInfo{name: "../config/cli/fleet-eth.prod.json", size: 3619, mode: os.FileMode(436), modTime: time.Unix(1687862441, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x92, 0x4f, 0x86, 0x8b, 0x6e, 0x2, 0x27, 0xa3, 0x37, 0x27, 0x74, 0x51, 0xf0, 0x97, 0x5b, 0x64, 0x8e, 0xbd, 0x29, 0xba, 0x75, 0x2d, 0x75, 0x78, 0x46, 0xb9, 0x56, 0x6, 0xb1, 0xf9, 0x85, 0xdd}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -203,8 +202,8 @@ func ConfigCliFleetEthStagingJson() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "../config/cli/fleet-eth.staging.json", size: 2139, mode: os.FileMode(0664), modTime: time.Unix(1686055892, 0)} info := bindataFileInfo{name: "../config/cli/fleet-eth.staging.json", size: 2139, mode: os.FileMode(436), modTime: time.Unix(1687862441, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xb0, 0xac, 0xc9, 0x61, 0x97, 0x42, 0x0, 0x3a, 0xfc, 0x78, 0x11, 0xa1, 0xc7, 0x55, 0x71, 0x46, 0x72, 0x3e, 0x52, 0xb0, 0x89, 0x69, 0x7f, 0x8f, 0xf1, 0x26, 0x44, 0xc5, 0xfc, 0x20, 0x9f, 0xa1}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -223,8 +222,8 @@ func ConfigCliFleetStatusProdJson() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "../config/cli/fleet-status.prod.json", size: 2338, mode: os.FileMode(0664), modTime: time.Unix(1686055892, 0)} info := bindataFileInfo{name: "../config/cli/fleet-status.prod.json", size: 2338, mode: os.FileMode(436), modTime: time.Unix(1687862441, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x59, 0xea, 0x14, 0x57, 0xed, 0x60, 0x4d, 0xb6, 0x32, 0x7e, 0xd3, 0xbe, 0x1e, 0xc7, 0xfe, 0x42, 0xee, 0xfe, 0x10, 0xe4, 0x22, 0x64, 0xc1, 0xb9, 0xce, 0x34, 0xcd, 0xdd, 0xe3, 0x38, 0x43, 0xd3}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -243,8 +242,8 @@ func ConfigCliFleetStatusTestJson() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "../config/cli/fleet-status.test.json", size: 1457, mode: os.FileMode(0664), modTime: time.Unix(1686055892, 0)} info := bindataFileInfo{name: "../config/cli/fleet-status.test.json", size: 1457, mode: os.FileMode(436), modTime: time.Unix(1687862441, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xc9, 0x9f, 0x8f, 0x25, 0x1f, 0x31, 0xbd, 0x72, 0x26, 0xb7, 0xd, 0x7e, 0xcb, 0xbb, 0x12, 0xef, 0x9f, 0x1a, 0x2e, 0xb, 0x96, 0x64, 0x7d, 0x52, 0x9e, 0x68, 0x13, 0x55, 0xd5, 0x88, 0x38, 0x7b}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -263,8 +262,8 @@ func ConfigCliFleetWakuv2ProdJson() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "../config/cli/fleet-wakuv2.prod.json", size: 1264, mode: os.FileMode(0664), modTime: time.Unix(1686055892, 0)} info := bindataFileInfo{name: "../config/cli/fleet-wakuv2.prod.json", size: 1264, mode: os.FileMode(436), modTime: time.Unix(1687862441, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x71, 0xb9, 0x1c, 0x57, 0x50, 0xa9, 0x93, 0x70, 0xcd, 0xd7, 0x22, 0xee, 0x65, 0x72, 0x11, 0x71, 0xd3, 0x20, 0xd0, 0xf0, 0x4d, 0x53, 0x94, 0x44, 0x81, 0xbd, 0x11, 0xed, 0x5e, 0x72, 0x0, 0x12}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -283,8 +282,8 @@ func ConfigCliFleetWakuv2TestJson() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "../config/cli/fleet-wakuv2.test.json", size: 1264, mode: os.FileMode(0664), modTime: time.Unix(1686055892, 0)} info := bindataFileInfo{name: "../config/cli/fleet-wakuv2.test.json", size: 1264, mode: os.FileMode(436), modTime: time.Unix(1687862441, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x2c, 0x67, 0x1e, 0xd1, 0x98, 0x7b, 0xf3, 0x9f, 0x76, 0xa0, 0xbe, 0x67, 0x29, 0xdb, 0xd7, 0x3e, 0xb8, 0x7c, 0x65, 0x2d, 0x2, 0x84, 0xe0, 0xab, 0x8d, 0x3d, 0x4a, 0x53, 0xb4, 0xa7, 0x2e, 0xf0}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -303,8 +302,8 @@ func ConfigCliLesEnabledJson() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "../config/cli/les-enabled.json", size: 58, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "../config/cli/les-enabled.json", size: 58, mode: os.FileMode(436), modTime: time.Unix(1687862441, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x7e, 0xee, 0x27, 0xa7, 0x74, 0xa0, 0x46, 0xa1, 0x41, 0xed, 0x4d, 0x16, 0x5b, 0xf3, 0xf0, 0x7c, 0xc8, 0x2f, 0x6f, 0x47, 0xa4, 0xbb, 0x5f, 0x43, 0x33, 0xd, 0x9, 0x9d, 0xea, 0x9e, 0x15, 0xee}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -323,8 +322,8 @@ func ConfigCliMailserverEnabledJson() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "../config/cli/mailserver-enabled.json", size: 176, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "../config/cli/mailserver-enabled.json", size: 176, mode: os.FileMode(436), modTime: time.Unix(1687862441, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x34, 0xec, 0x81, 0x8b, 0x99, 0xb6, 0xdb, 0xc0, 0x8b, 0x46, 0x97, 0x96, 0xc7, 0x58, 0x30, 0x33, 0xef, 0x54, 0x25, 0x87, 0x7b, 0xb9, 0x94, 0x6b, 0x18, 0xa4, 0x5b, 0x58, 0x67, 0x7c, 0x44, 0xa6}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -343,8 +342,8 @@ func ConfigStatusChainGenesisJson() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "../config/status-chain-genesis.json", size: 612, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "../config/status-chain-genesis.json", size: 612, mode: os.FileMode(436), modTime: time.Unix(1687862441, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xb, 0xf0, 0xc, 0x1, 0x95, 0x65, 0x6, 0x55, 0x48, 0x8f, 0x83, 0xa0, 0xb4, 0x81, 0xda, 0xad, 0x30, 0x6d, 0xb2, 0x78, 0x1b, 0x26, 0x4, 0x13, 0x12, 0x9, 0x6, 0xae, 0x3a, 0x2c, 0x1, 0x71}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -363,8 +362,8 @@ func keysBootnodeKey() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "keys/bootnode.key", size: 65, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "keys/bootnode.key", size: 65, mode: os.FileMode(436), modTime: time.Unix(1687862442, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x31, 0xcf, 0x27, 0xd4, 0x96, 0x2e, 0x32, 0xcd, 0x58, 0x96, 0x2a, 0xe5, 0x8c, 0xa0, 0xf1, 0x73, 0x1f, 0xd6, 0xd6, 0x8b, 0xb, 0x73, 0xd3, 0x2c, 0x84, 0x1a, 0x56, 0xa4, 0x74, 0xb6, 0x95, 0x20}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -383,8 +382,8 @@ func keysFirebaseauthkey() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "keys/firebaseauthkey", size: 153, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "keys/firebaseauthkey", size: 153, mode: os.FileMode(436), modTime: time.Unix(1687862442, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xe, 0x69, 0x23, 0x64, 0x7d, 0xf9, 0x14, 0x37, 0x6f, 0x2b, 0x1, 0xf0, 0xb0, 0xa4, 0xb2, 0xd0, 0x18, 0xcd, 0xf9, 0xeb, 0x57, 0xa3, 0xfd, 0x79, 0x25, 0xa7, 0x9c, 0x3, 0xce, 0x26, 0xec, 0xe1}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -403,8 +402,8 @@ func keysTestAccount1StatusChainPk() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "keys/test-account1-status-chain.pk", size: 489, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "keys/test-account1-status-chain.pk", size: 489, mode: os.FileMode(436), modTime: time.Unix(1687862442, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x8f, 0xba, 0x35, 0x1, 0x2b, 0x9d, 0xad, 0xf0, 0x2d, 0x3c, 0x4d, 0x6, 0xb5, 0x22, 0x2, 0x47, 0xd4, 0x1c, 0xf4, 0x31, 0x2f, 0xb, 0x5b, 0x27, 0x5d, 0x43, 0x97, 0x58, 0x2d, 0xf0, 0xe1, 0xbe}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -423,8 +422,8 @@ func keysTestAccount1Pk() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "keys/test-account1.pk", size: 491, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "keys/test-account1.pk", size: 491, mode: os.FileMode(436), modTime: time.Unix(1687862442, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x9, 0x43, 0xc2, 0xf4, 0x8c, 0xc6, 0x64, 0x25, 0x8c, 0x7, 0x8c, 0xa8, 0x89, 0x2b, 0x7b, 0x9b, 0x4f, 0x81, 0xcb, 0xce, 0x3d, 0xef, 0x82, 0x9c, 0x27, 0x27, 0xa9, 0xc5, 0x46, 0x70, 0x30, 0x38}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -443,8 +442,8 @@ func keysTestAccount2StatusChainPk() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "keys/test-account2-status-chain.pk", size: 489, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "keys/test-account2-status-chain.pk", size: 489, mode: os.FileMode(436), modTime: time.Unix(1687862442, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x9, 0xf8, 0x5c, 0xe9, 0x92, 0x96, 0x2d, 0x88, 0x2b, 0x8e, 0x42, 0x3f, 0xa4, 0x93, 0x6c, 0xad, 0xe9, 0xc0, 0x1b, 0x8a, 0x8, 0x8c, 0x5e, 0x7a, 0x84, 0xa2, 0xf, 0x9f, 0x77, 0x58, 0x2c, 0x2c}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -463,8 +462,8 @@ func keysTestAccount2Pk() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "keys/test-account2.pk", size: 491, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "keys/test-account2.pk", size: 491, mode: os.FileMode(436), modTime: time.Unix(1687862442, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x9f, 0x72, 0xd5, 0x95, 0x5c, 0x5a, 0x99, 0x9d, 0x2f, 0x21, 0x83, 0xd7, 0x10, 0x17, 0x4a, 0x3d, 0x65, 0xc9, 0x26, 0x1a, 0x2c, 0x9d, 0x65, 0x63, 0xd2, 0xa0, 0xfc, 0x7c, 0x0, 0x87, 0x38, 0x9f}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -483,8 +482,8 @@ func keysTestAccount3BeforeEip55Pk() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "keys/test-account3-before-eip55.pk", size: 489, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "keys/test-account3-before-eip55.pk", size: 489, mode: os.FileMode(436), modTime: time.Unix(1687862442, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x81, 0x40, 0x56, 0xc1, 0x5e, 0x10, 0x6e, 0x28, 0x15, 0x3, 0x4e, 0xc4, 0xc4, 0x71, 0x4d, 0x16, 0x99, 0xcc, 0x1b, 0x63, 0xee, 0x10, 0x20, 0xe4, 0x59, 0x52, 0x3f, 0xc0, 0xad, 0x15, 0x13, 0x72}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -492,8 +491,8 @@ func keysTestAccount3BeforeEip55Pk() (*asset, error) {
// It returns an error if the asset could not be found or // It returns an error if the asset could not be found or
// could not be loaded. // could not be loaded.
func Asset(name string) ([]byte, error) { func Asset(name string) ([]byte, error) {
canonicalName := strings.Replace(name, "\\", "/", -1) cannonicalName := strings.Replace(name, "\\", "/", -1)
if f, ok := _bindata[canonicalName]; ok { if f, ok := _bindata[cannonicalName]; ok {
a, err := f() a, err := f()
if err != nil { if err != nil {
return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err) return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err)
@ -503,12 +502,6 @@ func Asset(name string) ([]byte, error) {
return nil, fmt.Errorf("Asset %s not found", name) 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. // MustAsset is like Asset but panics when Asset would return an error.
// It simplifies safe initialization of global variables. // It simplifies safe initialization of global variables.
func MustAsset(name string) []byte { func MustAsset(name string) []byte {
@ -520,18 +513,12 @@ func MustAsset(name string) []byte {
return a 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. // AssetInfo loads and returns the asset info for the given name.
// It returns an error if the asset could not be found or // It returns an error if the asset could not be found or
// could not be loaded. // could not be loaded.
func AssetInfo(name string) (os.FileInfo, error) { func AssetInfo(name string) (os.FileInfo, error) {
canonicalName := strings.Replace(name, "\\", "/", -1) cannonicalName := strings.Replace(name, "\\", "/", -1)
if f, ok := _bindata[canonicalName]; ok { if f, ok := _bindata[cannonicalName]; ok {
a, err := f() a, err := f()
if err != nil { if err != nil {
return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err) return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err)
@ -541,33 +528,6 @@ func AssetInfo(name string) (os.FileInfo, error) {
return nil, fmt.Errorf("AssetInfo %s not found", name) 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. // AssetNames returns the names of the assets.
func AssetNames() []string { func AssetNames() []string {
names := make([]string, 0, len(_bindata)) names := make([]string, 0, len(_bindata))
@ -580,43 +540,24 @@ func AssetNames() []string {
// _bindata is a table, holding each asset generator, mapped to its name. // _bindata is a table, holding each asset generator, mapped to its name.
var _bindata = map[string]func() (*asset, error){ var _bindata = map[string]func() (*asset, error){
"emojis.txt": emojisTxt, "emojis.txt": emojisTxt,
"../config/README.md": ConfigReadmeMd, "../config/README.md": ConfigReadmeMd,
"../config/cli/anon-metric-node-client.json": ConfigCliAnonMetricNodeClientJson, "../config/cli/anon-metric-node-client.json": ConfigCliAnonMetricNodeClientJson,
"../config/cli/anon-metric-node-server.json": ConfigCliAnonMetricNodeServerJson, "../config/cli/anon-metric-node-server.json": ConfigCliAnonMetricNodeServerJson,
"../config/cli/fleet-eth.prod.json": ConfigCliFleetEthProdJson, "../config/cli/fleet-eth.prod.json": ConfigCliFleetEthProdJson,
"../config/cli/fleet-eth.staging.json": ConfigCliFleetEthStagingJson, "../config/cli/fleet-eth.staging.json": ConfigCliFleetEthStagingJson,
"../config/cli/fleet-status.prod.json": ConfigCliFleetStatusProdJson, "../config/cli/fleet-status.prod.json": ConfigCliFleetStatusProdJson,
"../config/cli/fleet-status.test.json": ConfigCliFleetStatusTestJson, "../config/cli/fleet-status.test.json": ConfigCliFleetStatusTestJson,
"../config/cli/fleet-wakuv2.prod.json": ConfigCliFleetWakuv2ProdJson, "../config/cli/fleet-wakuv2.prod.json": ConfigCliFleetWakuv2ProdJson,
"../config/cli/fleet-wakuv2.test.json": ConfigCliFleetWakuv2TestJson, "../config/cli/fleet-wakuv2.test.json": ConfigCliFleetWakuv2TestJson,
"../config/cli/les-enabled.json": ConfigCliLesEnabledJson, "../config/cli/les-enabled.json": ConfigCliLesEnabledJson,
"../config/cli/mailserver-enabled.json": ConfigCliMailserverEnabledJson, "../config/cli/mailserver-enabled.json": ConfigCliMailserverEnabledJson,
"../config/status-chain-genesis.json": ConfigStatusChainGenesisJson, "../config/status-chain-genesis.json": ConfigStatusChainGenesisJson,
"keys/bootnode.key": keysBootnodeKey, "keys/bootnode.key": keysBootnodeKey,
"keys/firebaseauthkey": keysFirebaseauthkey, "keys/firebaseauthkey": keysFirebaseauthkey,
"keys/test-account1-status-chain.pk": keysTestAccount1StatusChainPk, "keys/test-account1-status-chain.pk": keysTestAccount1StatusChainPk,
"keys/test-account1.pk": keysTestAccount1Pk, "keys/test-account1.pk": keysTestAccount1Pk,
"keys/test-account2-status-chain.pk": keysTestAccount2StatusChainPk, "keys/test-account2-status-chain.pk": keysTestAccount2StatusChainPk,
"keys/test-account2.pk": keysTestAccount2Pk, "keys/test-account2.pk": keysTestAccount2Pk,
"keys/test-account3-before-eip55.pk": keysTestAccount3BeforeEip55Pk, "keys/test-account3-before-eip55.pk": keysTestAccount3BeforeEip55Pk,
} }
@ -629,15 +570,15 @@ var _bindata = map[string]func() (*asset, error){
// img/ // img/
// a.png // a.png
// b.png // b.png
// then AssetDir("data") would return []string{"foo.txt", "img"}, // then AssetDir("data") would return []string{"foo.txt", "img"}
// AssetDir("data/img") would return []string{"a.png", "b.png"}, // AssetDir("data/img") would return []string{"a.png", "b.png"}
// AssetDir("foo.txt") and AssetDir("notexist") would return an error, and // AssetDir("foo.txt") and AssetDir("notexist") would return an error
// AssetDir("") will return []string{"data"}. // AssetDir("") will return []string{"data"}.
func AssetDir(name string) ([]string, error) { func AssetDir(name string) ([]string, error) {
node := _bintree node := _bintree
if len(name) != 0 { if len(name) != 0 {
canonicalName := strings.Replace(name, "\\", "/", -1) cannonicalName := strings.Replace(name, "\\", "/", -1)
pathList := strings.Split(canonicalName, "/") pathList := strings.Split(cannonicalName, "/")
for _, p := range pathList { for _, p := range pathList {
node = node.Children[p] node = node.Children[p]
if node == nil { if node == nil {
@ -659,7 +600,6 @@ type bintree struct {
Func func() (*asset, error) Func func() (*asset, error)
Children map[string]*bintree Children map[string]*bintree
} }
var _bintree = &bintree{nil, map[string]*bintree{ var _bintree = &bintree{nil, map[string]*bintree{
"..": &bintree{nil, map[string]*bintree{ "..": &bintree{nil, map[string]*bintree{
"config": &bintree{nil, map[string]*bintree{ "config": &bintree{nil, map[string]*bintree{
@ -667,31 +607,31 @@ var _bintree = &bintree{nil, map[string]*bintree{
"cli": &bintree{nil, map[string]*bintree{ "cli": &bintree{nil, map[string]*bintree{
"anon-metric-node-client.json": &bintree{ConfigCliAnonMetricNodeClientJson, map[string]*bintree{}}, "anon-metric-node-client.json": &bintree{ConfigCliAnonMetricNodeClientJson, map[string]*bintree{}},
"anon-metric-node-server.json": &bintree{ConfigCliAnonMetricNodeServerJson, map[string]*bintree{}}, "anon-metric-node-server.json": &bintree{ConfigCliAnonMetricNodeServerJson, map[string]*bintree{}},
"fleet-eth.prod.json": &bintree{ConfigCliFleetEthProdJson, map[string]*bintree{}}, "fleet-eth.prod.json": &bintree{ConfigCliFleetEthProdJson, map[string]*bintree{}},
"fleet-eth.staging.json": &bintree{ConfigCliFleetEthStagingJson, map[string]*bintree{}}, "fleet-eth.staging.json": &bintree{ConfigCliFleetEthStagingJson, map[string]*bintree{}},
"fleet-status.prod.json": &bintree{ConfigCliFleetStatusProdJson, map[string]*bintree{}}, "fleet-status.prod.json": &bintree{ConfigCliFleetStatusProdJson, map[string]*bintree{}},
"fleet-status.test.json": &bintree{ConfigCliFleetStatusTestJson, map[string]*bintree{}}, "fleet-status.test.json": &bintree{ConfigCliFleetStatusTestJson, map[string]*bintree{}},
"fleet-wakuv2.prod.json": &bintree{ConfigCliFleetWakuv2ProdJson, map[string]*bintree{}}, "fleet-wakuv2.prod.json": &bintree{ConfigCliFleetWakuv2ProdJson, map[string]*bintree{}},
"fleet-wakuv2.test.json": &bintree{ConfigCliFleetWakuv2TestJson, map[string]*bintree{}}, "fleet-wakuv2.test.json": &bintree{ConfigCliFleetWakuv2TestJson, map[string]*bintree{}},
"les-enabled.json": &bintree{ConfigCliLesEnabledJson, map[string]*bintree{}}, "les-enabled.json": &bintree{ConfigCliLesEnabledJson, map[string]*bintree{}},
"mailserver-enabled.json": &bintree{ConfigCliMailserverEnabledJson, map[string]*bintree{}}, "mailserver-enabled.json": &bintree{ConfigCliMailserverEnabledJson, map[string]*bintree{}},
}}, }},
"status-chain-genesis.json": &bintree{ConfigStatusChainGenesisJson, map[string]*bintree{}}, "status-chain-genesis.json": &bintree{ConfigStatusChainGenesisJson, map[string]*bintree{}},
}}, }},
}}, }},
"emojis.txt": &bintree{emojisTxt, map[string]*bintree{}}, "emojis.txt": &bintree{emojisTxt, map[string]*bintree{}},
"keys": &bintree{nil, map[string]*bintree{ "keys": &bintree{nil, map[string]*bintree{
"bootnode.key": &bintree{keysBootnodeKey, map[string]*bintree{}}, "bootnode.key": &bintree{keysBootnodeKey, map[string]*bintree{}},
"firebaseauthkey": &bintree{keysFirebaseauthkey, map[string]*bintree{}}, "firebaseauthkey": &bintree{keysFirebaseauthkey, map[string]*bintree{}},
"test-account1-status-chain.pk": &bintree{keysTestAccount1StatusChainPk, map[string]*bintree{}}, "test-account1-status-chain.pk": &bintree{keysTestAccount1StatusChainPk, map[string]*bintree{}},
"test-account1.pk": &bintree{keysTestAccount1Pk, map[string]*bintree{}}, "test-account1.pk": &bintree{keysTestAccount1Pk, map[string]*bintree{}},
"test-account2-status-chain.pk": &bintree{keysTestAccount2StatusChainPk, map[string]*bintree{}}, "test-account2-status-chain.pk": &bintree{keysTestAccount2StatusChainPk, map[string]*bintree{}},
"test-account2.pk": &bintree{keysTestAccount2Pk, map[string]*bintree{}}, "test-account2.pk": &bintree{keysTestAccount2Pk, map[string]*bintree{}},
"test-account3-before-eip55.pk": &bintree{keysTestAccount3BeforeEip55Pk, map[string]*bintree{}}, "test-account3-before-eip55.pk": &bintree{keysTestAccount3BeforeEip55Pk, map[string]*bintree{}},
}}, }},
}} }}
// RestoreAsset restores an asset under the given directory. // RestoreAsset restores an asset under the given directory
func RestoreAsset(dir, name string) error { func RestoreAsset(dir, name string) error {
data, err := Asset(name) data, err := Asset(name)
if err != nil { if err != nil {
@ -709,10 +649,14 @@ func RestoreAsset(dir, name string) error {
if err != nil { if err != nil {
return err return err
} }
return os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime()) 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. // RestoreAssets restores an asset under the given directory recursively
func RestoreAssets(dir, name string) error { func RestoreAssets(dir, name string) error {
children, err := AssetDir(name) children, err := AssetDir(name)
// File // File
@ -730,6 +674,7 @@ func RestoreAssets(dir, name string) error {
} }
func _filePath(dir, name string) string { func _filePath(dir, name string) string {
canonicalName := strings.Replace(name, "\\", "/", -1) cannonicalName := strings.Replace(name, "\\", "/", -1)
return filepath.Join(append([]string{dir}, strings.Split(canonicalName, "/")...)...) return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...)
} }

View File

@ -1,15 +1,15 @@
// Code generated by go-bindata. DO NOT EDIT. // Code generated by go-bindata.
// sources: // sources:
// config/public-chain-accounts.json (307B) // config/public-chain-accounts.json
// config/status-chain-accounts.json (543B) // config/status-chain-accounts.json
// config/test-data.json (84B) // config/test-data.json
// DO NOT EDIT!
package t package t
import ( import (
"bytes" "bytes"
"compress/gzip" "compress/gzip"
"crypto/sha256"
"fmt" "fmt"
"io" "io"
"io/ioutil" "io/ioutil"
@ -22,7 +22,7 @@ import (
func bindataRead(data []byte, name string) ([]byte, error) { func bindataRead(data []byte, name string) ([]byte, error) {
gz, err := gzip.NewReader(bytes.NewBuffer(data)) gz, err := gzip.NewReader(bytes.NewBuffer(data))
if err != nil { if err != nil {
return nil, fmt.Errorf("read %q: %v", name, err) return nil, fmt.Errorf("Read %q: %v", name, err)
} }
var buf bytes.Buffer var buf bytes.Buffer
@ -30,7 +30,7 @@ func bindataRead(data []byte, name string) ([]byte, error) {
clErr := gz.Close() clErr := gz.Close()
if err != nil { if err != nil {
return nil, fmt.Errorf("read %q: %v", name, err) return nil, fmt.Errorf("Read %q: %v", name, err)
} }
if clErr != nil { if clErr != nil {
return nil, err return nil, err
@ -40,9 +40,8 @@ func bindataRead(data []byte, name string) ([]byte, error) {
} }
type asset struct { type asset struct {
bytes []byte bytes []byte
info os.FileInfo info os.FileInfo
digest [sha256.Size]byte
} }
type bindataFileInfo struct { type bindataFileInfo struct {
@ -86,8 +85,8 @@ func configPublicChainAccountsJson() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "config/public-chain-accounts.json", size: 307, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "config/public-chain-accounts.json", size: 307, mode: os.FileMode(436), modTime: time.Unix(1687862442, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x76, 0x5d, 0xc0, 0xfe, 0x57, 0x50, 0x18, 0xec, 0x2d, 0x61, 0x1b, 0xa9, 0x81, 0x11, 0x5f, 0x77, 0xf7, 0xb6, 0x67, 0x82, 0x1, 0x40, 0x68, 0x9d, 0xc5, 0x41, 0xaf, 0xce, 0x43, 0x81, 0x92, 0x96}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -106,8 +105,8 @@ func configStatusChainAccountsJson() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "config/status-chain-accounts.json", size: 543, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "config/status-chain-accounts.json", size: 543, mode: os.FileMode(436), modTime: time.Unix(1687862442, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x8e, 0xb3, 0x61, 0x51, 0x70, 0x3c, 0x12, 0x3e, 0xf1, 0x1c, 0x81, 0xfb, 0x9a, 0x7c, 0xe3, 0x63, 0xd0, 0x8f, 0x12, 0xc5, 0x2d, 0xf4, 0xea, 0x27, 0x33, 0xef, 0xca, 0xf9, 0x3f, 0x72, 0x44, 0xbf}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -126,8 +125,8 @@ func configTestDataJson() (*asset, error) {
return nil, err return nil, err
} }
info := bindataFileInfo{name: "config/test-data.json", size: 84, mode: os.FileMode(0664), modTime: time.Unix(1685705602, 0)} info := bindataFileInfo{name: "config/test-data.json", size: 84, mode: os.FileMode(436), modTime: time.Unix(1687862442, 0)}
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xce, 0x9d, 0x80, 0xf5, 0x87, 0xfa, 0x57, 0x1d, 0xa1, 0xd5, 0x7a, 0x10, 0x3, 0xac, 0xd7, 0xf4, 0x64, 0x32, 0x96, 0x2b, 0xb7, 0x21, 0xb7, 0xa6, 0x80, 0x40, 0xe9, 0x65, 0xe3, 0xd6, 0xbd, 0x40}} a := &asset{bytes: bytes, info: info}
return a, nil return a, nil
} }
@ -135,8 +134,8 @@ func configTestDataJson() (*asset, error) {
// It returns an error if the asset could not be found or // It returns an error if the asset could not be found or
// could not be loaded. // could not be loaded.
func Asset(name string) ([]byte, error) { func Asset(name string) ([]byte, error) {
canonicalName := strings.Replace(name, "\\", "/", -1) cannonicalName := strings.Replace(name, "\\", "/", -1)
if f, ok := _bindata[canonicalName]; ok { if f, ok := _bindata[cannonicalName]; ok {
a, err := f() a, err := f()
if err != nil { if err != nil {
return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err) return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err)
@ -146,12 +145,6 @@ func Asset(name string) ([]byte, error) {
return nil, fmt.Errorf("Asset %s not found", name) 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. // MustAsset is like Asset but panics when Asset would return an error.
// It simplifies safe initialization of global variables. // It simplifies safe initialization of global variables.
func MustAsset(name string) []byte { func MustAsset(name string) []byte {
@ -163,18 +156,12 @@ func MustAsset(name string) []byte {
return a 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. // AssetInfo loads and returns the asset info for the given name.
// It returns an error if the asset could not be found or // It returns an error if the asset could not be found or
// could not be loaded. // could not be loaded.
func AssetInfo(name string) (os.FileInfo, error) { func AssetInfo(name string) (os.FileInfo, error) {
canonicalName := strings.Replace(name, "\\", "/", -1) cannonicalName := strings.Replace(name, "\\", "/", -1)
if f, ok := _bindata[canonicalName]; ok { if f, ok := _bindata[cannonicalName]; ok {
a, err := f() a, err := f()
if err != nil { if err != nil {
return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err) return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err)
@ -184,33 +171,6 @@ func AssetInfo(name string) (os.FileInfo, error) {
return nil, fmt.Errorf("AssetInfo %s not found", name) 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. // AssetNames returns the names of the assets.
func AssetNames() []string { func AssetNames() []string {
names := make([]string, 0, len(_bindata)) names := make([]string, 0, len(_bindata))
@ -223,9 +183,7 @@ func AssetNames() []string {
// _bindata is a table, holding each asset generator, mapped to its name. // _bindata is a table, holding each asset generator, mapped to its name.
var _bindata = map[string]func() (*asset, error){ var _bindata = map[string]func() (*asset, error){
"config/public-chain-accounts.json": configPublicChainAccountsJson, "config/public-chain-accounts.json": configPublicChainAccountsJson,
"config/status-chain-accounts.json": configStatusChainAccountsJson, "config/status-chain-accounts.json": configStatusChainAccountsJson,
"config/test-data.json": configTestDataJson, "config/test-data.json": configTestDataJson,
} }
@ -238,15 +196,15 @@ var _bindata = map[string]func() (*asset, error){
// img/ // img/
// a.png // a.png
// b.png // b.png
// then AssetDir("data") would return []string{"foo.txt", "img"}, // then AssetDir("data") would return []string{"foo.txt", "img"}
// AssetDir("data/img") would return []string{"a.png", "b.png"}, // AssetDir("data/img") would return []string{"a.png", "b.png"}
// AssetDir("foo.txt") and AssetDir("notexist") would return an error, and // AssetDir("foo.txt") and AssetDir("notexist") would return an error
// AssetDir("") will return []string{"data"}. // AssetDir("") will return []string{"data"}.
func AssetDir(name string) ([]string, error) { func AssetDir(name string) ([]string, error) {
node := _bintree node := _bintree
if len(name) != 0 { if len(name) != 0 {
canonicalName := strings.Replace(name, "\\", "/", -1) cannonicalName := strings.Replace(name, "\\", "/", -1)
pathList := strings.Split(canonicalName, "/") pathList := strings.Split(cannonicalName, "/")
for _, p := range pathList { for _, p := range pathList {
node = node.Children[p] node = node.Children[p]
if node == nil { if node == nil {
@ -268,16 +226,15 @@ type bintree struct {
Func func() (*asset, error) Func func() (*asset, error)
Children map[string]*bintree Children map[string]*bintree
} }
var _bintree = &bintree{nil, map[string]*bintree{ var _bintree = &bintree{nil, map[string]*bintree{
"config": &bintree{nil, map[string]*bintree{ "config": &bintree{nil, map[string]*bintree{
"public-chain-accounts.json": &bintree{configPublicChainAccountsJson, map[string]*bintree{}}, "public-chain-accounts.json": &bintree{configPublicChainAccountsJson, map[string]*bintree{}},
"status-chain-accounts.json": &bintree{configStatusChainAccountsJson, map[string]*bintree{}}, "status-chain-accounts.json": &bintree{configStatusChainAccountsJson, map[string]*bintree{}},
"test-data.json": &bintree{configTestDataJson, map[string]*bintree{}}, "test-data.json": &bintree{configTestDataJson, map[string]*bintree{}},
}}, }},
}} }}
// RestoreAsset restores an asset under the given directory. // RestoreAsset restores an asset under the given directory
func RestoreAsset(dir, name string) error { func RestoreAsset(dir, name string) error {
data, err := Asset(name) data, err := Asset(name)
if err != nil { if err != nil {
@ -295,10 +252,14 @@ func RestoreAsset(dir, name string) error {
if err != nil { if err != nil {
return err return err
} }
return os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime()) 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. // RestoreAssets restores an asset under the given directory recursively
func RestoreAssets(dir, name string) error { func RestoreAssets(dir, name string) error {
children, err := AssetDir(name) children, err := AssetDir(name)
// File // File
@ -316,6 +277,7 @@ func RestoreAssets(dir, name string) error {
} }
func _filePath(dir, name string) string { func _filePath(dir, name string) string {
canonicalName := strings.Replace(name, "\\", "/", -1) cannonicalName := strings.Replace(name, "\\", "/", -1)
return filepath.Join(append([]string{dir}, strings.Split(canonicalName, "/")...)...) return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...)
} }