vitess-gh/go/cmd/vtctld/main.go

37 строки
530 B
Go
Исходник Обычный вид История

2013-04-18 06:01:33 +04:00
package main
import (
"flag"
2013-09-14 07:19:14 +04:00
"github.com/youtube/vitess/go/vt/servenv"
"github.com/youtube/vitess/go/vt/topo"
2015-12-10 02:18:21 +03:00
"github.com/youtube/vitess/go/vt/vtctld"
2013-04-18 06:01:33 +04:00
)
func init() {
servenv.RegisterDefaultFlags()
}
// used at runtime by plug-ins
2015-11-13 05:41:42 +03:00
var (
2015-12-10 01:03:32 +03:00
ts topo.Server
2015-11-13 05:41:42 +03:00
)
2013-04-18 06:01:33 +04:00
func main() {
flag.Parse()
2013-09-14 07:19:14 +04:00
servenv.Init()
defer servenv.Close()
2013-05-17 00:16:22 +04:00
ts = topo.GetServer()
2013-07-18 02:52:34 +04:00
defer topo.CloseServers()
// Init the vtctld core
2015-12-10 02:18:21 +03:00
vtctld.InitVtctld(ts)
2015-01-05 01:25:46 +03:00
2015-11-13 05:41:42 +03:00
// Start schema manager service.
initSchema()
2015-11-13 05:41:42 +03:00
// And run the server.
servenv.RunDefault()
2013-04-18 06:01:33 +04:00
}