ServerMain is the main entry point of launching the Sync Gateway server; the main function directly calls this. It registers both signal and fatal panic handlers, does the initial setup and finally starts the server.
()
| 31 | // function directly calls this. It registers both signal and fatal panic handlers, |
| 32 | // does the initial setup and finally starts the server. |
| 33 | func ServerMain() { |
| 34 | ctx := context.Background() // main context |
| 35 | if err := serverMain(ctx, os.Args); err != nil { |
| 36 | base.FatalfCtx(ctx, "Couldn't start Sync Gateway: %v", err) |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | // TODO: Pass ctx down into HTTP servers so that serverMain can be stopped. |
| 41 | func serverMain(ctx context.Context, osArgs []string) error { |
no test coverage detected