Loading Gopkg.lock +13 −4 Original line number Diff line number Diff line Loading @@ -12,6 +12,11 @@ packages = ["."] revision = "c95af922eae69f190717a0b7148960af8c55a072" [[projects]] name = "github.com/gobuffalo/packr" packages = ["."] revision = "6434a292ac52e6964adebfdce3f9ce6d9f16be01" [[projects]] name = "github.com/golang/protobuf" packages = [ Loading Loading @@ -76,6 +81,12 @@ ] revision = "83612a56d3dd153a94a629cd64925371c9adad78" [[projects]] name = "github.com/pkg/errors" packages = ["."] revision = "645ef00459ed84a119197bfb8d8205042c6df63d" version = "v0.8.0" [[projects]] name = "github.com/rubenv/sql-migrate" packages = [ Loading Loading @@ -109,8 +120,7 @@ "stats", "tag", "trace", "trace/propagation", "zpages" "trace/propagation" ] revision = "7e6c5d736280267bc85cfd63b23507c4889ef82e" version = "v0.2.0" Loading Loading @@ -141,7 +151,6 @@ version = "v1.7.1" [[projects]] branch = "master" name = "golang.org/x/crypto" packages = [ "bcrypt", Loading Loading @@ -232,6 +241,6 @@ [solve-meta] analyzer-name = "dep" analyzer-version = 1 inputs-digest = "3dca4cdde39b8789a533da94987c9dac078157b93a881077b085310068091603" inputs-digest = "5d773d2802af4225a763597cd5656ef5fa212adb45f7e4cf3e46b3bc134947b7" solver-name = "gps-cdcl" solver-version = 1 Gopkg.toml +5 −0 Original line number Diff line number Diff line Loading @@ -48,7 +48,12 @@ [[constraint]] name = "golang.org/x/crypto" revision = "1875d0a70c90e57f11972aefd42276df65e895b9" [[constraint]] name = "go.opencensus.io" version = "0.2.0" [[constraint]] name = "github.com/gobuffalo/packr" revision = "6434a292ac52e6964adebfdce3f9ce6d9f16be01" README.md +2 −1 Original line number Diff line number Diff line Loading @@ -6,6 +6,7 @@ Install toolchain: go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger go get -u github.com/golang/protobuf/protoc-gen-go go get -u github.com/gobuffalo/packr/... ``` Build: Loading @@ -15,7 +16,7 @@ protoc -I/usr/local/include -I. -I$GOPATH/src -I$GOPATH/src/github.com/grpc-ecos protoc -I/usr/local/include -I. -I$GOPATH/src -I$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis --grpc-gateway_out=logtostderr=true:. ./api/api.proto go-bindata -pkg migration -prefix migrations -o migrations/embedded.go -ignore=embedded.go migrations/... packr -z go build -i Loading main.go +10 −7 Original line number Diff line number Diff line Loading @@ -16,7 +16,6 @@ package main import ( "fmt" "go.uber.org/zap" "net/http" "os" "os/signal" Loading @@ -24,14 +23,18 @@ import ( "syscall" "time" "go.uber.org/zap" "database/sql" "github.com/heroiclabs/nakama/cmd" "github.com/heroiclabs/nakama/server" "net/url" _ "github.com/lib/pq" "github.com/golang/protobuf/jsonpb" "github.com/heroiclabs/nakama/migrations" "github.com/heroiclabs/nakama/server" "math/rand" "github.com/golang/protobuf/jsonpb" _ "github.com/lib/pq" ) var ( Loading @@ -55,7 +58,7 @@ func main() { fmt.Println(semver) return case "migrate": cmd.MigrateParse(os.Args[2:], cmdLogger) migrations.Parse(os.Args[2:], cmdLogger) } } Loading @@ -71,7 +74,7 @@ func main() { multiLogger.Info("Database information", zap.String("version", dbVersion)) // Check migration status and log if the schema has diverged. cmd.MigrationStartupCheck(multiLogger, db) migrations.StartupCheck(multiLogger, db) // Shared utility components. jsonpbMarshaler := &jsonpb.Marshaler{ Loading migrations/embedded.godeleted 100644 → 0 +0 −235 Original line number Diff line number Diff line // Code generated by go-bindata. // sources: // migrations/20180103142000_initial_schema.sql // DO NOT EDIT! package migration import ( "bytes" "compress/gzip" "fmt" "io" "io/ioutil" "os" "path/filepath" "strings" "time" ) func bindataRead(data []byte, name string) ([]byte, error) { gz, err := gzip.NewReader(bytes.NewBuffer(data)) if err != nil { return nil, fmt.Errorf("Read %q: %v", name, err) } var buf bytes.Buffer _, err = io.Copy(&buf, gz) clErr := gz.Close() if err != nil { return nil, fmt.Errorf("Read %q: %v", name, err) } if clErr != nil { return nil, err } return buf.Bytes(), nil } type asset struct { bytes []byte info os.FileInfo } type bindataFileInfo struct { name string size int64 mode os.FileMode modTime time.Time } func (fi bindataFileInfo) Name() string { return fi.name } func (fi bindataFileInfo) Size() int64 { return fi.size } func (fi bindataFileInfo) Mode() os.FileMode { return fi.mode } func (fi bindataFileInfo) ModTime() time.Time { return fi.modTime } func (fi bindataFileInfo) IsDir() bool { return false } func (fi bindataFileInfo) Sys() interface{} { return nil } var __20180103142000_initial_schemaSql = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xa4\x56\x51\x93\x9b\x36\x17\x7d\xf7\xaf\xb8\xb3\x0f\x5f\x4c\x3e\xd6\x76\x9c\x64\x9a\xc9\xb6\x99\x21\x98\x4d\x98\x38\x38\x05\x9c\x74\x9f\x3c\x32\xba\x06\xcd\x82\x44\x25\xb1\x8e\xdb\xe9\x7f\xef\x08\xb0\x17\x6c\xaf\x33\x6d\xf7\x69\x2d\x1d\x9d\x7b\xef\xd1\xb9\x57\x8c\x9f\x0f\xe0\x39\xb8\xa2\xdc\x49\x96\x66\x1a\xa6\x93\x17\x6f\x20\xce\x10\x02\x72\x4f\x0a\x02\x4e\xa5\x33\x21\xd5\x00\x6a\xdc\x9c\x25\xc8\x15\x52\xa8\x38\x45\x09\x3a\x43\x70\x4a\x92\x64\xb8\xdf\xb1\xe1\x2b\x4a\xc5\x04\x87\xe9\x68\x02\x43\x03\xb8\x6a\xb7\xae\xac\x1b\x43\xb1\x13\x15\x14\x64\x07\x5c\x68\xa8\x14\x82\xce\x98\x82\x0d\xcb\x11\xf0\x7b\x82\xa5\x06\xc6\x21\x11\x45\x99\x33\xc2\x13\x84\x2d\xd3\x59\x1d\xa7\x65\x19\x19\x8e\xbb\x96\x43\xac\x35\x61\x1c\x08\x24\xa2\xdc\x81\xd8\x74\x81\x40\x74\x9b\x74\xa6\x75\xf9\x76\x3c\xde\x6e\xb7\x23\x52\x27\x3b\x12\x32\x1d\xe7\x0d\x4c\x8d\xe7\xbe\xeb\x05\x91\x77\x3d\x1d\x4d\xda\x03\x4b\x9e\xa3\x52\x20\xf1\xf7\x8a\x49\xa4\xb0\xde\x01\x29\xcb\x9c\x25\x64\x9d\x23\xe4\x64\x0b\x42\x02\x49\x25\x22\x05\x2d\x4c\xc2\x5b\xc9\x34\xe3\xa9\x0d\x4a\x6c\xf4\x96\x48\x34\x34\x94\x29\x2d\xd9\xba\xd2\x3d\xbd\xf6\xe9\x31\xd5\x03\x08\x0e\x84\xc3\x95\x13\x81\x1f\x5d\xc1\x7b\x27\xf2\x23\xdb\x90\x7c\xf3\xe3\x8f\x8b\x65\x0c\xdf\x9c\x30\x74\x82\xd8\xf7\x22\x58\x84\xe0\x2e\x82\x99\x1f\xfb\x8b\x20\x82\xc5\x2d\x38\xc1\x1d\x7c\xf2\x83\x99\x0d\xc8\x74\x86\x12\xf0\x7b\x29\x4d\x05\x42\x02\x33\x4a\x22\xad\x65\x8b\x10\x7b\x29\x6c\x44\x93\x92\x2a\x31\x61\x1b\x96\x40\x4e\x78\x5a\x91\x14\x21\x15\x0f\x28\x39\xe3\x29\x94\x28\x0b\xa6\xcc\x8d\x2a\x20\x9c\x1a\x9a\x9c\x15\x4c\x13\x5d\x2f\x9d\xd4\x65\x02\x8d\x07\x83\xeb\x6b\xf8\x7f\xc1\x52\x49\x34\xc2\xb2\x1c\xb8\xa1\xe7\xc4\x1e\xc4\xce\xfb\xb9\x07\xfe\x2d\x04\x8b\x18\xbc\xdf\xfc\x28\x8e\x8c\x07\xa4\x82\xe1\x00\x00\xe0\x4b\xe8\x7f\x76\xc2\x3b\xf8\xe4\xdd\xc1\x90\x51\xcb\x1e\xd4\xcb\x8c\x42\xe7\x6f\xb9\xf4\x67\x8f\xbf\x0c\x53\xb0\x9c\xcf\xed\x1a\x69\xc8\x38\x29\xb0\xd9\xfb\xea\x84\xee\x47\x27\x1c\xbe\x98\xbe\xb1\xc0\x68\x16\xc5\xa1\xe3\x07\x71\x13\x73\xb5\x07\xaf\xee\x71\x07\xcb\xc0\xff\x75\xe9\x1d\xd1\x51\xa6\xca\x9c\xec\x56\x0d\xe5\x9e\x6e\xfa\xfa\xb5\xd5\xec\x93\x07\xa2\x89\x5c\x55\x32\xef\x86\x7b\xdc\xbf\xbe\xae\xcd\xa7\xde\x8e\xc7\x5a\x88\x5c\x8d\x18\xea\x4d\xed\xbe\x4c\x17\xf9\x78\x9d\x94\xaf\x7e\xaa\x81\x46\xf8\x95\x26\xe9\x51\xde\x26\x6d\x98\x79\xb7\xce\x72\x1e\xc3\x33\xe4\xcf\x1a\xda\x5c\x24\xb5\xfc\x7d\x74\x1d\xd6\x84\xc4\x51\x3a\x82\xab\x88\x70\xb8\x95\x84\x27\x4c\x25\xc2\x06\xd7\xb9\xaa\xcf\x6a\x56\xe0\x1f\x82\xe3\xc5\xb3\x5f\x48\xe3\x87\x98\x15\x08\xc3\x65\x04\xff\x03\x97\x70\x42\x89\xd5\x90\x14\xa8\x09\x25\x9a\x34\x24\xef\xef\x62\xcf\x39\x5c\xc8\x21\xdd\x3f\xff\x7a\x06\xee\x47\xcf\xfd\x04\xc3\x1c\x79\xaa\xb3\xe1\xfe\x98\x05\x3f\xc3\xcb\xe9\x64\x32\xb1\x8e\xf4\xc6\x82\xb0\xfc\xc0\xd4\x4d\x0e\xda\x0b\x6a\x70\x25\x51\x6a\x2b\x24\x3d\x17\xbf\x1f\x72\x8f\x7c\x0c\xd9\x30\x6c\x48\x82\x6b\x21\xee\x57\xb5\xb7\xfa\x46\xe9\x46\x4a\x85\x48\x73\x5c\xb5\x0e\xbc\x80\x23\x05\x26\xc8\x35\x4a\x83\x7d\x1a\xa7\x34\x92\x62\x4f\x77\x01\x97\x54\x4a\x8b\xe2\xc7\x71\x91\xa6\xb8\x4a\x44\xc5\xb5\xf9\x65\xbc\x0d\x27\x37\x31\xd9\x6b\xd2\x01\xbf\xfb\x05\x4e\xd4\x4f\x24\x12\x8d\x2b\xe3\x10\xa3\xaa\xff\xa1\x43\xd7\x32\x74\x21\xef\x4e\x19\xaa\x92\xfe\x88\xa1\x0b\x39\xc3\xf0\x80\x92\x6d\x76\x17\x19\xba\x90\xa6\x8c\xc7\x42\x4f\xda\xd7\x4c\xec\x96\xed\x2c\x59\x0f\xf2\x14\xdb\xc0\xba\x19\xfc\x68\x84\xad\x28\x3e\xb0\x04\x9f\x1c\x64\x66\xf5\x76\x11\x7a\xfe\x87\xa0\x59\xad\x0f\x31\x6a\x41\xe8\xdd\x7a\xa1\x17\xb8\x5e\x3b\x0b\x6b\xbc\xe9\xc5\x78\x31\x5b\xbc\x85\x45\x00\x33\x6f\xee\xc5\x1e\xb8\x4e\xe4\x3a\x33\xef\x68\x28\xf6\xbc\x71\x3a\x0d\x8d\x85\x7a\x13\xf3\x1f\x15\x65\x1c\x73\xae\x24\x25\x2a\x99\x98\xb6\xb0\x41\x69\xa2\xd1\x86\x52\x28\x66\x66\xd2\xb9\x52\x0f\xe8\x7f\x53\xec\x09\x1b\x45\xa5\x19\xaf\x07\xe0\x7f\xd1\xef\x90\xd4\xd1\xab\xd2\x97\x70\x5f\x56\x2b\xde\xc1\x43\x07\x94\x09\xb4\x34\x5f\x44\xe6\x31\x55\x42\x6a\x10\xd2\x3c\x89\x82\x83\x14\x5b\xd5\x69\x0b\xba\x22\xba\x4f\xd2\x6b\x89\x7a\xfb\x4c\x47\xf4\xcb\x7d\x2a\xcf\xfa\x16\x1e\x5b\x3f\xfa\xec\xcc\xe7\x26\xc8\x99\xd6\x30\x19\x6f\x24\x43\x4e\x87\x13\xcb\x06\xc6\x1f\x98\xc6\xe1\x8b\xc3\xbf\x74\x38\xb5\x6c\x58\xe7\x22\xb9\x47\x3a\x7c\x69\xd9\x40\x31\x47\xb3\xfe\xca\xb2\x81\xc8\x24\x63\x0f\x48\x87\xaf\xad\x46\xc7\xf6\xe1\xec\x5a\xe2\xe8\x86\x6a\xa7\x75\x3f\x08\x66\x62\xcb\x07\xb3\x70\xf1\xe5\xd1\x78\xc7\xa6\xbb\xb9\xb0\xdf\x74\xda\x05\x84\xba\x19\xfc\x1d\x00\x00\xff\xff\x6f\x86\x8f\x0a\xd7\x0a\x00\x00") func _20180103142000_initial_schemaSqlBytes() ([]byte, error) { return bindataRead( __20180103142000_initial_schemaSql, "20180103142000_initial_schema.sql", ) } func _20180103142000_initial_schemaSql() (*asset, error) { bytes, err := _20180103142000_initial_schemaSqlBytes() if err != nil { return nil, err } info := bindataFileInfo{name: "20180103142000_initial_schema.sql", size: 2775, mode: os.FileMode(420), modTime: time.Unix(1518619465, 0)} a := &asset{bytes: bytes, info: info} return a, nil } // Asset loads and returns the asset for the given name. // It returns an error if the asset could not be found or // could not be loaded. func Asset(name string) ([]byte, error) { cannonicalName := strings.Replace(name, "\\", "/", -1) if f, ok := _bindata[cannonicalName]; ok { a, err := f() if err != nil { return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err) } return a.bytes, nil } return nil, fmt.Errorf("Asset %s not found", name) } // MustAsset is like Asset but panics when Asset would return an error. // It simplifies safe initialization of global variables. func MustAsset(name string) []byte { a, err := Asset(name) if err != nil { panic("asset: Asset(" + name + "): " + err.Error()) } return a } // AssetInfo loads and returns the asset info for the given name. // It returns an error if the asset could not be found or // could not be loaded. func AssetInfo(name string) (os.FileInfo, error) { cannonicalName := strings.Replace(name, "\\", "/", -1) if f, ok := _bindata[cannonicalName]; ok { a, err := f() if err != nil { return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err) } return a.info, nil } return nil, fmt.Errorf("AssetInfo %s not found", name) } // AssetNames returns the names of the assets. func AssetNames() []string { names := make([]string, 0, len(_bindata)) for name := range _bindata { names = append(names, name) } return names } // _bindata is a table, holding each asset generator, mapped to its name. var _bindata = map[string]func() (*asset, error){ "20180103142000_initial_schema.sql": _20180103142000_initial_schemaSql, } // AssetDir returns the file names below a certain // directory embedded in the file by go-bindata. // For example if you run go-bindata on data/... and data contains the // following hierarchy: // data/ // foo.txt // img/ // a.png // b.png // then AssetDir("data") would return []string{"foo.txt", "img"} // AssetDir("data/img") would return []string{"a.png", "b.png"} // AssetDir("foo.txt") and AssetDir("notexist") would return an error // AssetDir("") will return []string{"data"}. func AssetDir(name string) ([]string, error) { node := _bintree if len(name) != 0 { cannonicalName := strings.Replace(name, "\\", "/", -1) pathList := strings.Split(cannonicalName, "/") for _, p := range pathList { node = node.Children[p] if node == nil { return nil, fmt.Errorf("Asset %s not found", name) } } } if node.Func != nil { return nil, fmt.Errorf("Asset %s not found", name) } rv := make([]string, 0, len(node.Children)) for childName := range node.Children { rv = append(rv, childName) } return rv, nil } type bintree struct { Func func() (*asset, error) Children map[string]*bintree } var _bintree = &bintree{nil, map[string]*bintree{ "20180103142000_initial_schema.sql": &bintree{_20180103142000_initial_schemaSql, map[string]*bintree{}}, }} // RestoreAsset restores an asset under the given directory func RestoreAsset(dir, name string) error { data, err := Asset(name) if err != nil { return err } info, err := AssetInfo(name) if err != nil { return err } err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755)) if err != nil { return err } err = ioutil.WriteFile(_filePath(dir, name), data, info.Mode()) if err != nil { return err } err = os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime()) if err != nil { return err } return nil } // RestoreAssets restores an asset under the given directory recursively func RestoreAssets(dir, name string) error { children, err := AssetDir(name) // File if err != nil { return RestoreAsset(dir, name) } // Dir for _, child := range children { err = RestoreAssets(dir, filepath.Join(name, child)) if err != nil { return err } } return nil } func _filePath(dir, name string) string { cannonicalName := strings.Replace(name, "\\", "/", -1) return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...) } Loading
Gopkg.lock +13 −4 Original line number Diff line number Diff line Loading @@ -12,6 +12,11 @@ packages = ["."] revision = "c95af922eae69f190717a0b7148960af8c55a072" [[projects]] name = "github.com/gobuffalo/packr" packages = ["."] revision = "6434a292ac52e6964adebfdce3f9ce6d9f16be01" [[projects]] name = "github.com/golang/protobuf" packages = [ Loading Loading @@ -76,6 +81,12 @@ ] revision = "83612a56d3dd153a94a629cd64925371c9adad78" [[projects]] name = "github.com/pkg/errors" packages = ["."] revision = "645ef00459ed84a119197bfb8d8205042c6df63d" version = "v0.8.0" [[projects]] name = "github.com/rubenv/sql-migrate" packages = [ Loading Loading @@ -109,8 +120,7 @@ "stats", "tag", "trace", "trace/propagation", "zpages" "trace/propagation" ] revision = "7e6c5d736280267bc85cfd63b23507c4889ef82e" version = "v0.2.0" Loading Loading @@ -141,7 +151,6 @@ version = "v1.7.1" [[projects]] branch = "master" name = "golang.org/x/crypto" packages = [ "bcrypt", Loading Loading @@ -232,6 +241,6 @@ [solve-meta] analyzer-name = "dep" analyzer-version = 1 inputs-digest = "3dca4cdde39b8789a533da94987c9dac078157b93a881077b085310068091603" inputs-digest = "5d773d2802af4225a763597cd5656ef5fa212adb45f7e4cf3e46b3bc134947b7" solver-name = "gps-cdcl" solver-version = 1
Gopkg.toml +5 −0 Original line number Diff line number Diff line Loading @@ -48,7 +48,12 @@ [[constraint]] name = "golang.org/x/crypto" revision = "1875d0a70c90e57f11972aefd42276df65e895b9" [[constraint]] name = "go.opencensus.io" version = "0.2.0" [[constraint]] name = "github.com/gobuffalo/packr" revision = "6434a292ac52e6964adebfdce3f9ce6d9f16be01"
README.md +2 −1 Original line number Diff line number Diff line Loading @@ -6,6 +6,7 @@ Install toolchain: go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger go get -u github.com/golang/protobuf/protoc-gen-go go get -u github.com/gobuffalo/packr/... ``` Build: Loading @@ -15,7 +16,7 @@ protoc -I/usr/local/include -I. -I$GOPATH/src -I$GOPATH/src/github.com/grpc-ecos protoc -I/usr/local/include -I. -I$GOPATH/src -I$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis --grpc-gateway_out=logtostderr=true:. ./api/api.proto go-bindata -pkg migration -prefix migrations -o migrations/embedded.go -ignore=embedded.go migrations/... packr -z go build -i Loading
main.go +10 −7 Original line number Diff line number Diff line Loading @@ -16,7 +16,6 @@ package main import ( "fmt" "go.uber.org/zap" "net/http" "os" "os/signal" Loading @@ -24,14 +23,18 @@ import ( "syscall" "time" "go.uber.org/zap" "database/sql" "github.com/heroiclabs/nakama/cmd" "github.com/heroiclabs/nakama/server" "net/url" _ "github.com/lib/pq" "github.com/golang/protobuf/jsonpb" "github.com/heroiclabs/nakama/migrations" "github.com/heroiclabs/nakama/server" "math/rand" "github.com/golang/protobuf/jsonpb" _ "github.com/lib/pq" ) var ( Loading @@ -55,7 +58,7 @@ func main() { fmt.Println(semver) return case "migrate": cmd.MigrateParse(os.Args[2:], cmdLogger) migrations.Parse(os.Args[2:], cmdLogger) } } Loading @@ -71,7 +74,7 @@ func main() { multiLogger.Info("Database information", zap.String("version", dbVersion)) // Check migration status and log if the schema has diverged. cmd.MigrationStartupCheck(multiLogger, db) migrations.StartupCheck(multiLogger, db) // Shared utility components. jsonpbMarshaler := &jsonpb.Marshaler{ Loading
migrations/embedded.godeleted 100644 → 0 +0 −235 Original line number Diff line number Diff line // Code generated by go-bindata. // sources: // migrations/20180103142000_initial_schema.sql // DO NOT EDIT! package migration import ( "bytes" "compress/gzip" "fmt" "io" "io/ioutil" "os" "path/filepath" "strings" "time" ) func bindataRead(data []byte, name string) ([]byte, error) { gz, err := gzip.NewReader(bytes.NewBuffer(data)) if err != nil { return nil, fmt.Errorf("Read %q: %v", name, err) } var buf bytes.Buffer _, err = io.Copy(&buf, gz) clErr := gz.Close() if err != nil { return nil, fmt.Errorf("Read %q: %v", name, err) } if clErr != nil { return nil, err } return buf.Bytes(), nil } type asset struct { bytes []byte info os.FileInfo } type bindataFileInfo struct { name string size int64 mode os.FileMode modTime time.Time } func (fi bindataFileInfo) Name() string { return fi.name } func (fi bindataFileInfo) Size() int64 { return fi.size } func (fi bindataFileInfo) Mode() os.FileMode { return fi.mode } func (fi bindataFileInfo) ModTime() time.Time { return fi.modTime } func (fi bindataFileInfo) IsDir() bool { return false } func (fi bindataFileInfo) Sys() interface{} { return nil } var __20180103142000_initial_schemaSql = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xa4\x56\x51\x93\x9b\x36\x17\x7d\xf7\xaf\xb8\xb3\x0f\x5f\x4c\x3e\xd6\x76\x9c\x64\x9a\xc9\xb6\x99\x21\x98\x4d\x98\x38\x38\x05\x9c\x74\x9f\x3c\x32\xba\x06\xcd\x82\x44\x25\xb1\x8e\xdb\xe9\x7f\xef\x08\xb0\x17\x6c\xaf\x33\x6d\xf7\x69\x2d\x1d\x9d\x7b\xef\xd1\xb9\x57\x8c\x9f\x0f\xe0\x39\xb8\xa2\xdc\x49\x96\x66\x1a\xa6\x93\x17\x6f\x20\xce\x10\x02\x72\x4f\x0a\x02\x4e\xa5\x33\x21\xd5\x00\x6a\xdc\x9c\x25\xc8\x15\x52\xa8\x38\x45\x09\x3a\x43\x70\x4a\x92\x64\xb8\xdf\xb1\xe1\x2b\x4a\xc5\x04\x87\xe9\x68\x02\x43\x03\xb8\x6a\xb7\xae\xac\x1b\x43\xb1\x13\x15\x14\x64\x07\x5c\x68\xa8\x14\x82\xce\x98\x82\x0d\xcb\x11\xf0\x7b\x82\xa5\x06\xc6\x21\x11\x45\x99\x33\xc2\x13\x84\x2d\xd3\x59\x1d\xa7\x65\x19\x19\x8e\xbb\x96\x43\xac\x35\x61\x1c\x08\x24\xa2\xdc\x81\xd8\x74\x81\x40\x74\x9b\x74\xa6\x75\xf9\x76\x3c\xde\x6e\xb7\x23\x52\x27\x3b\x12\x32\x1d\xe7\x0d\x4c\x8d\xe7\xbe\xeb\x05\x91\x77\x3d\x1d\x4d\xda\x03\x4b\x9e\xa3\x52\x20\xf1\xf7\x8a\x49\xa4\xb0\xde\x01\x29\xcb\x9c\x25\x64\x9d\x23\xe4\x64\x0b\x42\x02\x49\x25\x22\x05\x2d\x4c\xc2\x5b\xc9\x34\xe3\xa9\x0d\x4a\x6c\xf4\x96\x48\x34\x34\x94\x29\x2d\xd9\xba\xd2\x3d\xbd\xf6\xe9\x31\xd5\x03\x08\x0e\x84\xc3\x95\x13\x81\x1f\x5d\xc1\x7b\x27\xf2\x23\xdb\x90\x7c\xf3\xe3\x8f\x8b\x65\x0c\xdf\x9c\x30\x74\x82\xd8\xf7\x22\x58\x84\xe0\x2e\x82\x99\x1f\xfb\x8b\x20\x82\xc5\x2d\x38\xc1\x1d\x7c\xf2\x83\x99\x0d\xc8\x74\x86\x12\xf0\x7b\x29\x4d\x05\x42\x02\x33\x4a\x22\xad\x65\x8b\x10\x7b\x29\x6c\x44\x93\x92\x2a\x31\x61\x1b\x96\x40\x4e\x78\x5a\x91\x14\x21\x15\x0f\x28\x39\xe3\x29\x94\x28\x0b\xa6\xcc\x8d\x2a\x20\x9c\x1a\x9a\x9c\x15\x4c\x13\x5d\x2f\x9d\xd4\x65\x02\x8d\x07\x83\xeb\x6b\xf8\x7f\xc1\x52\x49\x34\xc2\xb2\x1c\xb8\xa1\xe7\xc4\x1e\xc4\xce\xfb\xb9\x07\xfe\x2d\x04\x8b\x18\xbc\xdf\xfc\x28\x8e\x8c\x07\xa4\x82\xe1\x00\x00\xe0\x4b\xe8\x7f\x76\xc2\x3b\xf8\xe4\xdd\xc1\x90\x51\xcb\x1e\xd4\xcb\x8c\x42\xe7\x6f\xb9\xf4\x67\x8f\xbf\x0c\x53\xb0\x9c\xcf\xed\x1a\x69\xc8\x38\x29\xb0\xd9\xfb\xea\x84\xee\x47\x27\x1c\xbe\x98\xbe\xb1\xc0\x68\x16\xc5\xa1\xe3\x07\x71\x13\x73\xb5\x07\xaf\xee\x71\x07\xcb\xc0\xff\x75\xe9\x1d\xd1\x51\xa6\xca\x9c\xec\x56\x0d\xe5\x9e\x6e\xfa\xfa\xb5\xd5\xec\x93\x07\xa2\x89\x5c\x55\x32\xef\x86\x7b\xdc\xbf\xbe\xae\xcd\xa7\xde\x8e\xc7\x5a\x88\x5c\x8d\x18\xea\x4d\xed\xbe\x4c\x17\xf9\x78\x9d\x94\xaf\x7e\xaa\x81\x46\xf8\x95\x26\xe9\x51\xde\x26\x6d\x98\x79\xb7\xce\x72\x1e\xc3\x33\xe4\xcf\x1a\xda\x5c\x24\xb5\xfc\x7d\x74\x1d\xd6\x84\xc4\x51\x3a\x82\xab\x88\x70\xb8\x95\x84\x27\x4c\x25\xc2\x06\xd7\xb9\xaa\xcf\x6a\x56\xe0\x1f\x82\xe3\xc5\xb3\x5f\x48\xe3\x87\x98\x15\x08\xc3\x65\x04\xff\x03\x97\x70\x42\x89\xd5\x90\x14\xa8\x09\x25\x9a\x34\x24\xef\xef\x62\xcf\x39\x5c\xc8\x21\xdd\x3f\xff\x7a\x06\xee\x47\xcf\xfd\x04\xc3\x1c\x79\xaa\xb3\xe1\xfe\x98\x05\x3f\xc3\xcb\xe9\x64\x32\xb1\x8e\xf4\xc6\x82\xb0\xfc\xc0\xd4\x4d\x0e\xda\x0b\x6a\x70\x25\x51\x6a\x2b\x24\x3d\x17\xbf\x1f\x72\x8f\x7c\x0c\xd9\x30\x6c\x48\x82\x6b\x21\xee\x57\xb5\xb7\xfa\x46\xe9\x46\x4a\x85\x48\x73\x5c\xb5\x0e\xbc\x80\x23\x05\x26\xc8\x35\x4a\x83\x7d\x1a\xa7\x34\x92\x62\x4f\x77\x01\x97\x54\x4a\x8b\xe2\xc7\x71\x91\xa6\xb8\x4a\x44\xc5\xb5\xf9\x65\xbc\x0d\x27\x37\x31\xd9\x6b\xd2\x01\xbf\xfb\x05\x4e\xd4\x4f\x24\x12\x8d\x2b\xe3\x10\xa3\xaa\xff\xa1\x43\xd7\x32\x74\x21\xef\x4e\x19\xaa\x92\xfe\x88\xa1\x0b\x39\xc3\xf0\x80\x92\x6d\x76\x17\x19\xba\x90\xa6\x8c\xc7\x42\x4f\xda\xd7\x4c\xec\x96\xed\x2c\x59\x0f\xf2\x14\xdb\xc0\xba\x19\xfc\x68\x84\xad\x28\x3e\xb0\x04\x9f\x1c\x64\x66\xf5\x76\x11\x7a\xfe\x87\xa0\x59\xad\x0f\x31\x6a\x41\xe8\xdd\x7a\xa1\x17\xb8\x5e\x3b\x0b\x6b\xbc\xe9\xc5\x78\x31\x5b\xbc\x85\x45\x00\x33\x6f\xee\xc5\x1e\xb8\x4e\xe4\x3a\x33\xef\x68\x28\xf6\xbc\x71\x3a\x0d\x8d\x85\x7a\x13\xf3\x1f\x15\x65\x1c\x73\xae\x24\x25\x2a\x99\x98\xb6\xb0\x41\x69\xa2\xd1\x86\x52\x28\x66\x66\xd2\xb9\x52\x0f\xe8\x7f\x53\xec\x09\x1b\x45\xa5\x19\xaf\x07\xe0\x7f\xd1\xef\x90\xd4\xd1\xab\xd2\x97\x70\x5f\x56\x2b\xde\xc1\x43\x07\x94\x09\xb4\x34\x5f\x44\xe6\x31\x55\x42\x6a\x10\xd2\x3c\x89\x82\x83\x14\x5b\xd5\x69\x0b\xba\x22\xba\x4f\xd2\x6b\x89\x7a\xfb\x4c\x47\xf4\xcb\x7d\x2a\xcf\xfa\x16\x1e\x5b\x3f\xfa\xec\xcc\xe7\x26\xc8\x99\xd6\x30\x19\x6f\x24\x43\x4e\x87\x13\xcb\x06\xc6\x1f\x98\xc6\xe1\x8b\xc3\xbf\x74\x38\xb5\x6c\x58\xe7\x22\xb9\x47\x3a\x7c\x69\xd9\x40\x31\x47\xb3\xfe\xca\xb2\x81\xc8\x24\x63\x0f\x48\x87\xaf\xad\x46\xc7\xf6\xe1\xec\x5a\xe2\xe8\x86\x6a\xa7\x75\x3f\x08\x66\x62\xcb\x07\xb3\x70\xf1\xe5\xd1\x78\xc7\xa6\xbb\xb9\xb0\xdf\x74\xda\x05\x84\xba\x19\xfc\x1d\x00\x00\xff\xff\x6f\x86\x8f\x0a\xd7\x0a\x00\x00") func _20180103142000_initial_schemaSqlBytes() ([]byte, error) { return bindataRead( __20180103142000_initial_schemaSql, "20180103142000_initial_schema.sql", ) } func _20180103142000_initial_schemaSql() (*asset, error) { bytes, err := _20180103142000_initial_schemaSqlBytes() if err != nil { return nil, err } info := bindataFileInfo{name: "20180103142000_initial_schema.sql", size: 2775, mode: os.FileMode(420), modTime: time.Unix(1518619465, 0)} a := &asset{bytes: bytes, info: info} return a, nil } // Asset loads and returns the asset for the given name. // It returns an error if the asset could not be found or // could not be loaded. func Asset(name string) ([]byte, error) { cannonicalName := strings.Replace(name, "\\", "/", -1) if f, ok := _bindata[cannonicalName]; ok { a, err := f() if err != nil { return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err) } return a.bytes, nil } return nil, fmt.Errorf("Asset %s not found", name) } // MustAsset is like Asset but panics when Asset would return an error. // It simplifies safe initialization of global variables. func MustAsset(name string) []byte { a, err := Asset(name) if err != nil { panic("asset: Asset(" + name + "): " + err.Error()) } return a } // AssetInfo loads and returns the asset info for the given name. // It returns an error if the asset could not be found or // could not be loaded. func AssetInfo(name string) (os.FileInfo, error) { cannonicalName := strings.Replace(name, "\\", "/", -1) if f, ok := _bindata[cannonicalName]; ok { a, err := f() if err != nil { return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err) } return a.info, nil } return nil, fmt.Errorf("AssetInfo %s not found", name) } // AssetNames returns the names of the assets. func AssetNames() []string { names := make([]string, 0, len(_bindata)) for name := range _bindata { names = append(names, name) } return names } // _bindata is a table, holding each asset generator, mapped to its name. var _bindata = map[string]func() (*asset, error){ "20180103142000_initial_schema.sql": _20180103142000_initial_schemaSql, } // AssetDir returns the file names below a certain // directory embedded in the file by go-bindata. // For example if you run go-bindata on data/... and data contains the // following hierarchy: // data/ // foo.txt // img/ // a.png // b.png // then AssetDir("data") would return []string{"foo.txt", "img"} // AssetDir("data/img") would return []string{"a.png", "b.png"} // AssetDir("foo.txt") and AssetDir("notexist") would return an error // AssetDir("") will return []string{"data"}. func AssetDir(name string) ([]string, error) { node := _bintree if len(name) != 0 { cannonicalName := strings.Replace(name, "\\", "/", -1) pathList := strings.Split(cannonicalName, "/") for _, p := range pathList { node = node.Children[p] if node == nil { return nil, fmt.Errorf("Asset %s not found", name) } } } if node.Func != nil { return nil, fmt.Errorf("Asset %s not found", name) } rv := make([]string, 0, len(node.Children)) for childName := range node.Children { rv = append(rv, childName) } return rv, nil } type bintree struct { Func func() (*asset, error) Children map[string]*bintree } var _bintree = &bintree{nil, map[string]*bintree{ "20180103142000_initial_schema.sql": &bintree{_20180103142000_initial_schemaSql, map[string]*bintree{}}, }} // RestoreAsset restores an asset under the given directory func RestoreAsset(dir, name string) error { data, err := Asset(name) if err != nil { return err } info, err := AssetInfo(name) if err != nil { return err } err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755)) if err != nil { return err } err = ioutil.WriteFile(_filePath(dir, name), data, info.Mode()) if err != nil { return err } err = os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime()) if err != nil { return err } return nil } // RestoreAssets restores an asset under the given directory recursively func RestoreAssets(dir, name string) error { children, err := AssetDir(name) // File if err != nil { return RestoreAsset(dir, name) } // Dir for _, child := range children { err = RestoreAssets(dir, filepath.Join(name, child)) if err != nil { return err } } return nil } func _filePath(dir, name string) string { cannonicalName := strings.Replace(name, "\\", "/", -1) return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...) }