MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / startMirrorServer

Function startMirrorServer

cmd/cql/internal/mirror.go:56–72  ·  view source on GitHub ↗
(mirrorDatabase string, mirrorAddr string)

Source from the content-addressed store, hash-verified

54}
55
56func startMirrorServer(mirrorDatabase string, mirrorAddr string) func() {
57 var err error
58 mirrorService, err = mirror.StartMirror(mirrorDatabase, mirrorAddr)
59 if err != nil {
60 ConsoleLog.WithError(err).Error("start mirror failed")
61 SetExitStatus(1)
62 return nil
63 }
64
65 ConsoleLog.Infof("mirror server started on %s", mirrorAddr)
66 // TODO(): print sample command for cql to connect
67
68 return func() {
69 mirror.StopMirror(mirrorService)
70 ConsoleLog.Info("mirror stopped")
71 }
72}
73
74func runMirror(cmd *Command, args []string) {
75 commonFlagsInit(cmd)

Callers 1

runMirrorFunction · 0.85

Calls 7

StartMirrorFunction · 0.92
StopMirrorFunction · 0.92
SetExitStatusFunction · 0.85
ErrorMethod · 0.80
WithErrorMethod · 0.80
InfofMethod · 0.80
InfoMethod · 0.80

Tested by

no test coverage detected