MCPcopy Create free account
hub / github.com/CovenantSQL/CovenantSQL / main

Function main

cmd/cql-mysql-adapter/main.go:58–94  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

56}
57
58func main() {
59 flag.Parse()
60 log.SetStringLevel(logLevel, log.InfoLevel)
61 if showVersion {
62 fmt.Printf("%v %v %v %v %v\n",
63 name, version, runtime.GOOS, runtime.GOARCH, runtime.Version())
64 os.Exit(0)
65 }
66
67 configFile = utils.HomeDirExpand(configFile)
68
69 flag.Visit(func(f *flag.Flag) {
70 log.Infof("args %#v : %s", f.Name, f.Value)
71 })
72
73 // init client
74 if err := client.Init(configFile, []byte(password)); err != nil {
75 log.WithError(err).Fatal("init covenantsql client failed")
76 return
77 }
78
79 server, err := NewServer(listenAddr, mysqlUser, mysqlPassword)
80 if err != nil {
81 log.WithError(err).Fatal("init server failed")
82 return
83 }
84
85 go server.Serve()
86
87 log.Info("start mysql adapter")
88
89 <-utils.WaitForExit()
90
91 server.Shutdown()
92
93 log.Info("stopped mysql adapter")
94}

Callers

nothing calls this directly

Calls 12

ServeMethod · 0.95
ShutdownMethod · 0.95
SetStringLevelFunction · 0.92
HomeDirExpandFunction · 0.92
InfofFunction · 0.92
InitFunction · 0.92
WithErrorFunction · 0.92
InfoFunction · 0.92
WaitForExitFunction · 0.92
FatalMethod · 0.80
NewServerFunction · 0.70
PrintfMethod · 0.45

Tested by

no test coverage detected