github.com/status-im/status-go@v1.1.0/protocol/anonmetrics/migrations/migrations.go (about) 1 // Code generated by go-bindata. DO NOT EDIT. 2 // sources: 3 // 1619446565_postgres_make_anon_metrics_table.down.sql (24B) 4 // 1619446565_postgres_make_anon_metrics_table.up.sql (443B) 5 // doc.go (400B) 6 7 package migrations 8 9 import ( 10 "bytes" 11 "compress/gzip" 12 "crypto/sha256" 13 "fmt" 14 "io" 15 "os" 16 "path/filepath" 17 "strings" 18 "time" 19 ) 20 21 func bindataRead(data []byte, name string) ([]byte, error) { 22 gz, err := gzip.NewReader(bytes.NewBuffer(data)) 23 if err != nil { 24 return nil, fmt.Errorf("read %q: %w", name, err) 25 } 26 27 var buf bytes.Buffer 28 _, err = io.Copy(&buf, gz) 29 clErr := gz.Close() 30 31 if err != nil { 32 return nil, fmt.Errorf("read %q: %w", name, err) 33 } 34 if clErr != nil { 35 return nil, err 36 } 37 38 return buf.Bytes(), nil 39 } 40 41 type asset struct { 42 bytes []byte 43 info os.FileInfo 44 digest [sha256.Size]byte 45 } 46 47 type bindataFileInfo struct { 48 name string 49 size int64 50 mode os.FileMode 51 modTime time.Time 52 } 53 54 func (fi bindataFileInfo) Name() string { 55 return fi.name 56 } 57 func (fi bindataFileInfo) Size() int64 { 58 return fi.size 59 } 60 func (fi bindataFileInfo) Mode() os.FileMode { 61 return fi.mode 62 } 63 func (fi bindataFileInfo) ModTime() time.Time { 64 return fi.modTime 65 } 66 func (fi bindataFileInfo) IsDir() bool { 67 return false 68 } 69 func (fi bindataFileInfo) Sys() interface{} { 70 return nil 71 } 72 73 var __1619446565_postgres_make_anon_metrics_tableDownSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x72\x09\xf2\x0f\x50\x08\x71\x74\xf2\x71\x55\x48\x2c\x28\x88\xcf\x4d\x2d\x29\xca\x4c\x2e\xb6\xe6\x02\x04\x00\x00\xff\xff\x99\xa7\x42\x7d\x18\x00\x00\x00") 74 75 func _1619446565_postgres_make_anon_metrics_tableDownSqlBytes() ([]byte, error) { 76 return bindataRead( 77 __1619446565_postgres_make_anon_metrics_tableDownSql, 78 "1619446565_postgres_make_anon_metrics_table.down.sql", 79 ) 80 } 81 82 func _1619446565_postgres_make_anon_metrics_tableDownSql() (*asset, error) { 83 bytes, err := _1619446565_postgres_make_anon_metrics_tableDownSqlBytes() 84 if err != nil { 85 return nil, err 86 } 87 88 info := bindataFileInfo{name: "1619446565_postgres_make_anon_metrics_table.down.sql", size: 24, mode: os.FileMode(0644), modTime: time.Unix(1700000000, 0)} 89 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}} 90 return a, nil 91 } 92 93 var __1619446565_postgres_make_anon_metrics_tableUpSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x74\x90\x4d\x6a\xc3\x30\x14\x84\xf7\x39\xc5\x2c\xdb\x10\xc8\x01\xba\x52\xdc\x17\xea\x56\xb6\x53\x59\x2e\x64\x65\x84\xfd\x30\x82\xfa\x07\x49\x75\xe9\xed\x8b\x1d\x92\x38\x81\xac\xbf\xef\x69\x46\x13\x29\x12\x9a\xa0\xc5\x4e\x12\xcc\x30\x94\x2d\x07\x67\x2b\x8f\xa7\x15\x00\xd8\x1a\x39\xa9\x58\x48\x1c\x54\x9c\x08\x75\xc4\x07\x1d\x37\xab\x99\x6d\xd7\x88\xbb\xaa\x6f\x6d\xd7\xe0\x74\x85\xda\x04\x83\xf5\x76\xc6\x2d\x7b\x6f\x1a\x2e\x6d\x8d\x2f\xa1\xa2\x37\xa1\x50\xa4\xf1\x67\x41\x48\x33\x8d\xb4\x90\x72\x33\x7b\x3c\x72\x17\x2e\xca\x2d\x1b\xcd\xf7\x0f\xe3\x3d\xcf\xd2\x3b\x30\x35\x1d\xd9\x79\xdb\x77\x0f\x4e\xfb\x81\x9d\x09\xb6\x6b\x4a\xff\xe7\x03\xb7\x0f\x34\xcf\x7e\x7a\x64\xd9\xf2\x56\xa8\x1c\x9b\xc0\x75\x69\x02\x74\x9c\x50\xae\x45\x72\x58\x28\xe7\x25\x54\xff\x3b\x8d\x60\x96\x0b\x0c\xae\xaf\xd8\x7b\xae\xb1\xcb\x32\x49\xe2\xfa\x09\xbc\xd2\x5e\x14\x52\x63\x2f\x64\x4e\xa7\x20\xc7\x15\xdb\xf1\x3e\xe9\x2c\x46\x85\x52\x94\xea\xf2\x42\x9e\x5f\xfe\x03\x00\x00\xff\xff\xee\x42\x32\x03\xbb\x01\x00\x00") 94 95 func _1619446565_postgres_make_anon_metrics_tableUpSqlBytes() ([]byte, error) { 96 return bindataRead( 97 __1619446565_postgres_make_anon_metrics_tableUpSql, 98 "1619446565_postgres_make_anon_metrics_table.up.sql", 99 ) 100 } 101 102 func _1619446565_postgres_make_anon_metrics_tableUpSql() (*asset, error) { 103 bytes, err := _1619446565_postgres_make_anon_metrics_tableUpSqlBytes() 104 if err != nil { 105 return nil, err 106 } 107 108 info := bindataFileInfo{name: "1619446565_postgres_make_anon_metrics_table.up.sql", size: 443, mode: os.FileMode(0644), modTime: time.Unix(1700000000, 0)} 109 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}} 110 return a, nil 111 } 112 113 var _docGo = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x84\x8f\xbd\x6a\x03\x31\x10\x84\xfb\x7b\x8a\xc1\x8d\x9b\x9c\x94\x40\x20\x10\x48\x91\x32\x7d\x5e\x60\x2d\xed\x49\xc2\x27\xed\xa1\xdd\xf3\xcf\xdb\x87\x73\x0c\x71\x97\x2d\x3f\xf8\x66\x66\xbd\xc7\x77\x2e\x8a\xa9\xcc\x8c\xa2\x68\x1c\x58\x95\xfa\x15\x07\x0e\xb4\x2a\x63\x97\x8a\xe5\xf5\xe0\x82\x54\xaf\x46\xb6\xea\x58\xaa\xaf\x25\x75\x32\xf6\xa7\xd7\xdd\xe0\x3d\x02\xb5\xbd\x21\x53\x8b\x33\xdf\xb2\x14\x6a\xd4\xad\xb4\x84\x73\xb1\x0c\xc2\xd2\x79\x2a\x17\x87\x4f\xc3\xcc\xa4\x06\xcb\x64\x7b\x85\x65\x46\x20\xe5\x2d\x66\x92\x8e\x24\xe3\xa1\xb4\x48\x46\x6e\x43\x5f\xd3\x03\xd9\x16\x06\x9a\x67\x8e\x98\xba\xd4\x9b\xab\x54\x19\xb1\x74\x0e\x26\xfd\xfa\x04\x52\x65\x43\xa3\xca\xba\xf9\x99\x4e\x8c\x26\xf7\x7a\x50\x8b\xff\x7f\x84\xb3\xf4\xa3\x82\x14\x7c\x59\x38\x18\x47\x37\x0c\x0b\x85\x23\x25\xc6\x22\x6a\xa9\xb3\x0e\x83\xf7\x49\xde\x13\x37\xde\xbc\xc7\x95\x63\x95\x68\xa5\xf2\xc7\xcb\xdb\xf3\xfd\x30\x2e\xc7\x84\xdf\x8e\x22\x4d\x31\x0a\x9c\xf3\x7f\xc0\x25\x81\xf3\xc3\x4f\x00\x00\x00\xff\xff\xe2\x75\x5f\x6c\x90\x01\x00\x00") 114 115 func docGoBytes() ([]byte, error) { 116 return bindataRead( 117 _docGo, 118 "doc.go", 119 ) 120 } 121 122 func docGo() (*asset, error) { 123 bytes, err := docGoBytes() 124 if err != nil { 125 return nil, err 126 } 127 128 info := bindataFileInfo{name: "doc.go", size: 400, mode: os.FileMode(0644), modTime: time.Unix(1700000000, 0)} 129 a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xf0, 0xa9, 0x91, 0x6, 0x5d, 0x91, 0xf7, 0x39, 0x3d, 0xc3, 0xf8, 0x5e, 0x4f, 0x7e, 0x7a, 0x8c, 0x60, 0x68, 0x66, 0x7d, 0x52, 0xe4, 0xd8, 0x23, 0x84, 0x55, 0x2c, 0x38, 0xa1, 0x64, 0xe7, 0xe6}} 130 return a, nil 131 } 132 133 // Asset loads and returns the asset for the given name. 134 // It returns an error if the asset could not be found or 135 // could not be loaded. 136 func Asset(name string) ([]byte, error) { 137 canonicalName := strings.Replace(name, "\\", "/", -1) 138 if f, ok := _bindata[canonicalName]; ok { 139 a, err := f() 140 if err != nil { 141 return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err) 142 } 143 return a.bytes, nil 144 } 145 return nil, fmt.Errorf("Asset %s not found", name) 146 } 147 148 // AssetString returns the asset contents as a string (instead of a []byte). 149 func AssetString(name string) (string, error) { 150 data, err := Asset(name) 151 return string(data), err 152 } 153 154 // MustAsset is like Asset but panics when Asset would return an error. 155 // It simplifies safe initialization of global variables. 156 func MustAsset(name string) []byte { 157 a, err := Asset(name) 158 if err != nil { 159 panic("asset: Asset(" + name + "): " + err.Error()) 160 } 161 162 return a 163 } 164 165 // MustAssetString is like AssetString but panics when Asset would return an 166 // error. It simplifies safe initialization of global variables. 167 func MustAssetString(name string) string { 168 return string(MustAsset(name)) 169 } 170 171 // AssetInfo loads and returns the asset info for the given name. 172 // It returns an error if the asset could not be found or 173 // could not be loaded. 174 func AssetInfo(name string) (os.FileInfo, error) { 175 canonicalName := strings.Replace(name, "\\", "/", -1) 176 if f, ok := _bindata[canonicalName]; ok { 177 a, err := f() 178 if err != nil { 179 return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err) 180 } 181 return a.info, nil 182 } 183 return nil, fmt.Errorf("AssetInfo %s not found", name) 184 } 185 186 // AssetDigest returns the digest of the file with the given name. It returns an 187 // error if the asset could not be found or the digest could not be loaded. 188 func AssetDigest(name string) ([sha256.Size]byte, error) { 189 canonicalName := strings.Replace(name, "\\", "/", -1) 190 if f, ok := _bindata[canonicalName]; ok { 191 a, err := f() 192 if err != nil { 193 return [sha256.Size]byte{}, fmt.Errorf("AssetDigest %s can't read by error: %v", name, err) 194 } 195 return a.digest, nil 196 } 197 return [sha256.Size]byte{}, fmt.Errorf("AssetDigest %s not found", name) 198 } 199 200 // Digests returns a map of all known files and their checksums. 201 func Digests() (map[string][sha256.Size]byte, error) { 202 mp := make(map[string][sha256.Size]byte, len(_bindata)) 203 for name := range _bindata { 204 a, err := _bindata[name]() 205 if err != nil { 206 return nil, err 207 } 208 mp[name] = a.digest 209 } 210 return mp, nil 211 } 212 213 // AssetNames returns the names of the assets. 214 func AssetNames() []string { 215 names := make([]string, 0, len(_bindata)) 216 for name := range _bindata { 217 names = append(names, name) 218 } 219 return names 220 } 221 222 // _bindata is a table, holding each asset generator, mapped to its name. 223 var _bindata = map[string]func() (*asset, error){ 224 "1619446565_postgres_make_anon_metrics_table.down.sql": _1619446565_postgres_make_anon_metrics_tableDownSql, 225 "1619446565_postgres_make_anon_metrics_table.up.sql": _1619446565_postgres_make_anon_metrics_tableUpSql, 226 "doc.go": docGo, 227 } 228 229 // AssetDebug is true if the assets were built with the debug flag enabled. 230 const AssetDebug = false 231 232 // AssetDir returns the file names below a certain 233 // directory embedded in the file by go-bindata. 234 // For example if you run go-bindata on data/... and data contains the 235 // following hierarchy: 236 // 237 // data/ 238 // foo.txt 239 // img/ 240 // a.png 241 // b.png 242 // 243 // then AssetDir("data") would return []string{"foo.txt", "img"}, 244 // AssetDir("data/img") would return []string{"a.png", "b.png"}, 245 // AssetDir("foo.txt") and AssetDir("notexist") would return an error, and 246 // AssetDir("") will return []string{"data"}. 247 func AssetDir(name string) ([]string, error) { 248 node := _bintree 249 if len(name) != 0 { 250 canonicalName := strings.Replace(name, "\\", "/", -1) 251 pathList := strings.Split(canonicalName, "/") 252 for _, p := range pathList { 253 node = node.Children[p] 254 if node == nil { 255 return nil, fmt.Errorf("Asset %s not found", name) 256 } 257 } 258 } 259 if node.Func != nil { 260 return nil, fmt.Errorf("Asset %s not found", name) 261 } 262 rv := make([]string, 0, len(node.Children)) 263 for childName := range node.Children { 264 rv = append(rv, childName) 265 } 266 return rv, nil 267 } 268 269 type bintree struct { 270 Func func() (*asset, error) 271 Children map[string]*bintree 272 } 273 274 var _bintree = &bintree{nil, map[string]*bintree{ 275 "1619446565_postgres_make_anon_metrics_table.down.sql": {_1619446565_postgres_make_anon_metrics_tableDownSql, map[string]*bintree{}}, 276 "1619446565_postgres_make_anon_metrics_table.up.sql": {_1619446565_postgres_make_anon_metrics_tableUpSql, map[string]*bintree{}}, 277 "doc.go": {docGo, map[string]*bintree{}}, 278 }} 279 280 // RestoreAsset restores an asset under the given directory. 281 func RestoreAsset(dir, name string) error { 282 data, err := Asset(name) 283 if err != nil { 284 return err 285 } 286 info, err := AssetInfo(name) 287 if err != nil { 288 return err 289 } 290 err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755)) 291 if err != nil { 292 return err 293 } 294 err = os.WriteFile(_filePath(dir, name), data, info.Mode()) 295 if err != nil { 296 return err 297 } 298 return os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime()) 299 } 300 301 // RestoreAssets restores an asset under the given directory recursively. 302 func RestoreAssets(dir, name string) error { 303 children, err := AssetDir(name) 304 // File 305 if err != nil { 306 return RestoreAsset(dir, name) 307 } 308 // Dir 309 for _, child := range children { 310 err = RestoreAssets(dir, filepath.Join(name, child)) 311 if err != nil { 312 return err 313 } 314 } 315 return nil 316 } 317 318 func _filePath(dir, name string) string { 319 canonicalName := strings.Replace(name, "\\", "/", -1) 320 return filepath.Join(append([]string{dir}, strings.Split(canonicalName, "/")...)...) 321 }