mirror of
https://github.com/logos-messaging/storenode-messages-counter.git
synced 2026-01-07 08:33:13 +00:00
320 lines
9.6 KiB
Go
320 lines
9.6 KiB
Go
|
|
// Code generated by go-bindata. DO NOT EDIT.
|
||
|
|
// sources:
|
||
|
|
// 1_messages.down.sql (34B)
|
||
|
|
// 1_messages.up.sql (192B)
|
||
|
|
// doc.go (74B)
|
||
|
|
|
||
|
|
package migrations
|
||
|
|
|
||
|
|
import (
|
||
|
|
"bytes"
|
||
|
|
"compress/gzip"
|
||
|
|
"crypto/sha256"
|
||
|
|
"fmt"
|
||
|
|
"io"
|
||
|
|
"io/ioutil"
|
||
|
|
"os"
|
||
|
|
"path/filepath"
|
||
|
|
"strings"
|
||
|
|
"time"
|
||
|
|
)
|
||
|
|
|
||
|
|
func bindataRead(data []byte, name string) ([]byte, error) {
|
||
|
|
gz, err := gzip.NewReader(bytes.NewBuffer(data))
|
||
|
|
if err != nil {
|
||
|
|
return nil, fmt.Errorf("read %q: %v", name, err)
|
||
|
|
}
|
||
|
|
|
||
|
|
var buf bytes.Buffer
|
||
|
|
_, err = io.Copy(&buf, gz)
|
||
|
|
clErr := gz.Close()
|
||
|
|
|
||
|
|
if err != nil {
|
||
|
|
return nil, fmt.Errorf("read %q: %v", name, err)
|
||
|
|
}
|
||
|
|
if clErr != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
|
||
|
|
return buf.Bytes(), nil
|
||
|
|
}
|
||
|
|
|
||
|
|
type asset struct {
|
||
|
|
bytes []byte
|
||
|
|
info os.FileInfo
|
||
|
|
digest [sha256.Size]byte
|
||
|
|
}
|
||
|
|
|
||
|
|
type bindataFileInfo struct {
|
||
|
|
name string
|
||
|
|
size int64
|
||
|
|
mode os.FileMode
|
||
|
|
modTime time.Time
|
||
|
|
}
|
||
|
|
|
||
|
|
func (fi bindataFileInfo) Name() string {
|
||
|
|
return fi.name
|
||
|
|
}
|
||
|
|
func (fi bindataFileInfo) Size() int64 {
|
||
|
|
return fi.size
|
||
|
|
}
|
||
|
|
func (fi bindataFileInfo) Mode() os.FileMode {
|
||
|
|
return fi.mode
|
||
|
|
}
|
||
|
|
func (fi bindataFileInfo) ModTime() time.Time {
|
||
|
|
return fi.modTime
|
||
|
|
}
|
||
|
|
func (fi bindataFileInfo) IsDir() bool {
|
||
|
|
return false
|
||
|
|
}
|
||
|
|
func (fi bindataFileInfo) Sys() interface{} {
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
var __1_messagesDownSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x72\x09\xf2\x0f\x50\x08\x71\x74\xf2\x71\x55\xf0\x74\x53\x70\x8d\xf0\x0c\x0e\x09\x56\x28\xae\xcc\x4b\x8e\x2f\xc9\x2f\xc8\x4c\x2e\xb6\xe6\x02\x04\x00\x00\xff\xff\xb2\x54\x30\xb5\x22\x00\x00\x00")
|
||
|
|
|
||
|
|
func _1_messagesDownSqlBytes() ([]byte, error) {
|
||
|
|
return bindataRead(
|
||
|
|
__1_messagesDownSql,
|
||
|
|
"1_messages.down.sql",
|
||
|
|
)
|
||
|
|
}
|
||
|
|
|
||
|
|
func _1_messagesDownSql() (*asset, error) {
|
||
|
|
bytes, err := _1_messagesDownSqlBytes()
|
||
|
|
if err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
|
||
|
|
info := bindataFileInfo{name: "1_messages.down.sql", size: 34, mode: os.FileMode(0664), modTime: time.Unix(1715177338, 0)}
|
||
|
|
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x37, 0x66, 0x71, 0x87, 0x7d, 0xb7, 0xb1, 0x90, 0x2, 0x5e, 0x13, 0xb3, 0xb8, 0xa3, 0x93, 0x72, 0xb5, 0x8, 0xf, 0x79, 0xaf, 0xba, 0xfc, 0x38, 0x64, 0x79, 0x48, 0xac, 0x30, 0x59, 0x80, 0x21}}
|
||
|
|
return a, nil
|
||
|
|
}
|
||
|
|
|
||
|
|
var __1_messagesUpSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x6c\xcd\x31\xae\x82\x40\x14\x85\xe1\x1a\x56\x71\x4a\x48\xd8\xc1\xab\xe6\xe1\x55\x6e\x44\x30\xc3\x45\xa4\x32\x30\x52\x90\x00\x12\x67\x28\xd8\xbd\xd1\xc2\x68\x62\x7d\xfe\x7c\x27\xd6\xa4\x84\x20\xea\x3f\x25\xf0\x16\x59\x2e\xa0\x33\x17\x52\xc0\xae\x93\xb9\xb8\xdb\xdc\x1b\x8b\xc0\xf7\xcc\xb0\x58\xd7\xdd\xf9\x0a\xce\x84\x76\xa4\x5f\x6d\x56\xa6\x69\xe4\x7b\xf3\xd2\xda\xa5\x95\x67\x8c\x93\xd2\x71\xa2\xbe\xe6\xa1\xb1\xae\x58\x27\x23\xfd\xd8\x59\xd7\x8c\xf3\x2f\xe3\xa8\xf9\xa0\x74\x8d\x3d\xd5\x08\xde\x6f\x11\x3e\xec\xd0\x0f\x51\xb1\x24\x79\x29\xd0\x79\xc5\x9b\xbf\x47\x00\x00\x00\xff\xff\x19\xfe\xc7\x67\xc0\x00\x00\x00")
|
||
|
|
|
||
|
|
func _1_messagesUpSqlBytes() ([]byte, error) {
|
||
|
|
return bindataRead(
|
||
|
|
__1_messagesUpSql,
|
||
|
|
"1_messages.up.sql",
|
||
|
|
)
|
||
|
|
}
|
||
|
|
|
||
|
|
func _1_messagesUpSql() (*asset, error) {
|
||
|
|
bytes, err := _1_messagesUpSqlBytes()
|
||
|
|
if err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
|
||
|
|
info := bindataFileInfo{name: "1_messages.up.sql", size: 192, mode: os.FileMode(0664), modTime: time.Unix(1715177323, 0)}
|
||
|
|
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x7b, 0xd, 0x5e, 0xfd, 0xd, 0x7f, 0x5a, 0xac, 0x26, 0x8f, 0xd2, 0xc5, 0xfe, 0xcc, 0xf6, 0xfd, 0x95, 0x56, 0x40, 0xd4, 0xed, 0xe, 0x27, 0x33, 0x7d, 0xc5, 0x66, 0x86, 0x9c, 0xff, 0x2b, 0x47}}
|
||
|
|
return a, nil
|
||
|
|
}
|
||
|
|
|
||
|
|
var _docGo = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x2c\xc9\xb1\x0d\xc4\x20\x0c\x05\xd0\x9e\x29\xfe\x02\xd8\xfd\x6d\xe3\x4b\xac\x2f\x44\x82\x09\x78\x7f\xa5\x49\xfd\xa6\x1d\xdd\xe8\xd8\xcf\x55\x8a\x2a\xe3\x47\x1f\xbe\x2c\x1d\x8c\xfa\x6f\xe3\xb4\x34\xd4\xd9\x89\xbb\x71\x59\xb6\x18\x1b\x35\x20\xa2\x9f\x0a\x03\xa2\xe5\x0d\x00\x00\xff\xff\x60\xcd\x06\xbe\x4a\x00\x00\x00")
|
||
|
|
|
||
|
|
func docGoBytes() ([]byte, error) {
|
||
|
|
return bindataRead(
|
||
|
|
_docGo,
|
||
|
|
"doc.go",
|
||
|
|
)
|
||
|
|
}
|
||
|
|
|
||
|
|
func docGo() (*asset, error) {
|
||
|
|
bytes, err := docGoBytes()
|
||
|
|
if err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
|
||
|
|
info := bindataFileInfo{name: "doc.go", size: 74, mode: os.FileMode(0664), modTime: time.Unix(1715177003, 0)}
|
||
|
|
a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xde, 0x7c, 0x28, 0xcd, 0x47, 0xf2, 0xfa, 0x7c, 0x51, 0x2d, 0xd8, 0x38, 0xb, 0xb0, 0x34, 0x9d, 0x4c, 0x62, 0xa, 0x9e, 0x28, 0xc3, 0x31, 0x23, 0xd9, 0xbb, 0x89, 0x9f, 0xa0, 0x89, 0x1f, 0xe8}}
|
||
|
|
return a, nil
|
||
|
|
}
|
||
|
|
|
||
|
|
// Asset loads and returns the asset for the given name.
|
||
|
|
// It returns an error if the asset could not be found or
|
||
|
|
// could not be loaded.
|
||
|
|
func Asset(name string) ([]byte, error) {
|
||
|
|
canonicalName := strings.Replace(name, "\\", "/", -1)
|
||
|
|
if f, ok := _bindata[canonicalName]; ok {
|
||
|
|
a, err := f()
|
||
|
|
if err != nil {
|
||
|
|
return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err)
|
||
|
|
}
|
||
|
|
return a.bytes, nil
|
||
|
|
}
|
||
|
|
return nil, fmt.Errorf("Asset %s not found", name)
|
||
|
|
}
|
||
|
|
|
||
|
|
// AssetString returns the asset contents as a string (instead of a []byte).
|
||
|
|
func AssetString(name string) (string, error) {
|
||
|
|
data, err := Asset(name)
|
||
|
|
return string(data), err
|
||
|
|
}
|
||
|
|
|
||
|
|
// MustAsset is like Asset but panics when Asset would return an error.
|
||
|
|
// It simplifies safe initialization of global variables.
|
||
|
|
func MustAsset(name string) []byte {
|
||
|
|
a, err := Asset(name)
|
||
|
|
if err != nil {
|
||
|
|
panic("asset: Asset(" + name + "): " + err.Error())
|
||
|
|
}
|
||
|
|
|
||
|
|
return a
|
||
|
|
}
|
||
|
|
|
||
|
|
// MustAssetString is like AssetString but panics when Asset would return an
|
||
|
|
// error. It simplifies safe initialization of global variables.
|
||
|
|
func MustAssetString(name string) string {
|
||
|
|
return string(MustAsset(name))
|
||
|
|
}
|
||
|
|
|
||
|
|
// AssetInfo loads and returns the asset info for the given name.
|
||
|
|
// It returns an error if the asset could not be found or
|
||
|
|
// could not be loaded.
|
||
|
|
func AssetInfo(name string) (os.FileInfo, error) {
|
||
|
|
canonicalName := strings.Replace(name, "\\", "/", -1)
|
||
|
|
if f, ok := _bindata[canonicalName]; ok {
|
||
|
|
a, err := f()
|
||
|
|
if err != nil {
|
||
|
|
return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err)
|
||
|
|
}
|
||
|
|
return a.info, nil
|
||
|
|
}
|
||
|
|
return nil, fmt.Errorf("AssetInfo %s not found", name)
|
||
|
|
}
|
||
|
|
|
||
|
|
// AssetDigest returns the digest of the file with the given name. It returns an
|
||
|
|
// error if the asset could not be found or the digest could not be loaded.
|
||
|
|
func AssetDigest(name string) ([sha256.Size]byte, error) {
|
||
|
|
canonicalName := strings.Replace(name, "\\", "/", -1)
|
||
|
|
if f, ok := _bindata[canonicalName]; ok {
|
||
|
|
a, err := f()
|
||
|
|
if err != nil {
|
||
|
|
return [sha256.Size]byte{}, fmt.Errorf("AssetDigest %s can't read by error: %v", name, err)
|
||
|
|
}
|
||
|
|
return a.digest, nil
|
||
|
|
}
|
||
|
|
return [sha256.Size]byte{}, fmt.Errorf("AssetDigest %s not found", name)
|
||
|
|
}
|
||
|
|
|
||
|
|
// Digests returns a map of all known files and their checksums.
|
||
|
|
func Digests() (map[string][sha256.Size]byte, error) {
|
||
|
|
mp := make(map[string][sha256.Size]byte, len(_bindata))
|
||
|
|
for name := range _bindata {
|
||
|
|
a, err := _bindata[name]()
|
||
|
|
if err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
mp[name] = a.digest
|
||
|
|
}
|
||
|
|
return mp, nil
|
||
|
|
}
|
||
|
|
|
||
|
|
// AssetNames returns the names of the assets.
|
||
|
|
func AssetNames() []string {
|
||
|
|
names := make([]string, 0, len(_bindata))
|
||
|
|
for name := range _bindata {
|
||
|
|
names = append(names, name)
|
||
|
|
}
|
||
|
|
return names
|
||
|
|
}
|
||
|
|
|
||
|
|
// _bindata is a table, holding each asset generator, mapped to its name.
|
||
|
|
var _bindata = map[string]func() (*asset, error){
|
||
|
|
"1_messages.down.sql": _1_messagesDownSql,
|
||
|
|
|
||
|
|
"1_messages.up.sql": _1_messagesUpSql,
|
||
|
|
|
||
|
|
"doc.go": docGo,
|
||
|
|
}
|
||
|
|
|
||
|
|
// AssetDir returns the file names below a certain
|
||
|
|
// directory embedded in the file by go-bindata.
|
||
|
|
// For example if you run go-bindata on data/... and data contains the
|
||
|
|
// following hierarchy:
|
||
|
|
// data/
|
||
|
|
// foo.txt
|
||
|
|
// img/
|
||
|
|
// a.png
|
||
|
|
// b.png
|
||
|
|
// then AssetDir("data") would return []string{"foo.txt", "img"},
|
||
|
|
// AssetDir("data/img") would return []string{"a.png", "b.png"},
|
||
|
|
// AssetDir("foo.txt") and AssetDir("notexist") would return an error, and
|
||
|
|
// AssetDir("") will return []string{"data"}.
|
||
|
|
func AssetDir(name string) ([]string, error) {
|
||
|
|
node := _bintree
|
||
|
|
if len(name) != 0 {
|
||
|
|
canonicalName := strings.Replace(name, "\\", "/", -1)
|
||
|
|
pathList := strings.Split(canonicalName, "/")
|
||
|
|
for _, p := range pathList {
|
||
|
|
node = node.Children[p]
|
||
|
|
if node == nil {
|
||
|
|
return nil, fmt.Errorf("Asset %s not found", name)
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
if node.Func != nil {
|
||
|
|
return nil, fmt.Errorf("Asset %s not found", name)
|
||
|
|
}
|
||
|
|
rv := make([]string, 0, len(node.Children))
|
||
|
|
for childName := range node.Children {
|
||
|
|
rv = append(rv, childName)
|
||
|
|
}
|
||
|
|
return rv, nil
|
||
|
|
}
|
||
|
|
|
||
|
|
type bintree struct {
|
||
|
|
Func func() (*asset, error)
|
||
|
|
Children map[string]*bintree
|
||
|
|
}
|
||
|
|
|
||
|
|
var _bintree = &bintree{nil, map[string]*bintree{
|
||
|
|
"1_messages.down.sql": &bintree{_1_messagesDownSql, map[string]*bintree{}},
|
||
|
|
"1_messages.up.sql": &bintree{_1_messagesUpSql, map[string]*bintree{}},
|
||
|
|
"doc.go": &bintree{docGo, map[string]*bintree{}},
|
||
|
|
}}
|
||
|
|
|
||
|
|
// RestoreAsset restores an asset under the given directory.
|
||
|
|
func RestoreAsset(dir, name string) error {
|
||
|
|
data, err := Asset(name)
|
||
|
|
if err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
info, err := AssetInfo(name)
|
||
|
|
if err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755))
|
||
|
|
if err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
err = ioutil.WriteFile(_filePath(dir, name), data, info.Mode())
|
||
|
|
if err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
return os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime())
|
||
|
|
}
|
||
|
|
|
||
|
|
// RestoreAssets restores an asset under the given directory recursively.
|
||
|
|
func RestoreAssets(dir, name string) error {
|
||
|
|
children, err := AssetDir(name)
|
||
|
|
// File
|
||
|
|
if err != nil {
|
||
|
|
return RestoreAsset(dir, name)
|
||
|
|
}
|
||
|
|
// Dir
|
||
|
|
for _, child := range children {
|
||
|
|
err = RestoreAssets(dir, filepath.Join(name, child))
|
||
|
|
if err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
}
|
||
|
|
return nil
|
||
|
|
}
|
||
|
|
|
||
|
|
func _filePath(dir, name string) string {
|
||
|
|
canonicalName := strings.Replace(name, "\\", "/", -1)
|
||
|
|
return filepath.Join(append([]string{dir}, strings.Split(canonicalName, "/")...)...)
|
||
|
|
}
|