()
| 22 | ) |
| 23 | |
| 24 | func main() { |
| 25 | ctx, cancel := context.WithCancel(context.Background()) |
| 26 | |
| 27 | sigs := make(chan os.Signal, 1) |
| 28 | signal.Notify(sigs, syscall.SIGTERM, syscall.SIGINT) |
| 29 | go func() { |
| 30 | s := <-sigs |
| 31 | cancel() |
| 32 | println(printPrefix, "Received", s) |
| 33 | println(printPrefix, "Exiting") |
| 34 | }() |
| 35 | |
| 36 | res, err := extensionClient.Register(ctx, extensionName) |
| 37 | if err != nil { |
| 38 | panic(err) |
| 39 | } |
| 40 | println(printPrefix, "Register response:", prettyPrint(res)) |
| 41 | |
| 42 | // Will block until shutdown event is received or cancelled via the context. |
| 43 | processEvents(ctx) |
| 44 | } |
| 45 | |
| 46 | func processEvents(ctx context.Context) { |
| 47 | for { |
nothing calls this directly
no test coverage detected