()
| 18 | ) |
| 19 | |
| 20 | func main() { |
| 21 | ctx, cancel := context.WithCancel(context.Background()) |
| 22 | |
| 23 | sigs := make(chan os.Signal, 1) |
| 24 | signal.Notify(sigs, syscall.SIGTERM, syscall.SIGINT) |
| 25 | go func() { |
| 26 | s := <-sigs |
| 27 | cancel() |
| 28 | println(plugins.PrintPrefix, "Received", s) |
| 29 | println(plugins.PrintPrefix, "Exiting") |
| 30 | }() |
| 31 | |
| 32 | res, err := extensionClient.Register(ctx, plugins.ExtensionName) |
| 33 | if err != nil { |
| 34 | panic(err) |
| 35 | } |
| 36 | println(plugins.PrintPrefix, "Register response:", plugins.PrettyPrint(res)) |
| 37 | |
| 38 | // Initialize all the cache plugins |
| 39 | extension.InitCacheExtensions() |
| 40 | |
| 41 | // Start HTTP server |
| 42 | ipc.Start("4000") |
| 43 | |
| 44 | // Will block until shutdown event is received or cancelled via the context. |
| 45 | processEvents(ctx) |
| 46 | } |
| 47 | |
| 48 | // Method to process events |
| 49 | func processEvents(ctx context.Context) { |
nothing calls this directly
no test coverage detected