From a12ad2fa89aff3c14b74b9859d773ef8ae28a17f Mon Sep 17 00:00:00 2001 From: Gabriel Adrian Samfira Date: Thu, 8 Aug 2024 09:29:15 +0000 Subject: [PATCH] Fix example spaces vs tabs Signed-off-by: Gabriel Adrian Samfira --- doc/events.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/doc/events.md b/doc/events.md index 086a59e1..6bc61a9d 100644 --- a/doc/events.md +++ b/doc/events.md @@ -211,35 +211,35 @@ func printToConsoleHandler(_ int, msg []byte) error { } func main() { - // Set up the context to listen for signals. + // Set up the context to listen for signals. ctx, stop := signal.NotifyContext(context.Background(), signals...) defer stop() - // This is the JWT token you got from the curl command above. + // This is the JWT token you got from the curl command above. token := "superSecretJWTToken" - // The base URL of your GARM server + // The base URL of your GARM server baseURL := "https://garm.example.com" - // This is the path to the events endpoint + // This is the path to the events endpoint pth := "/api/v1/ws/events" - // Instantiate the websocket reader + // Instantiate the websocket reader reader, err := garmWs.NewReader(ctx, baseURL, pth, token, printToConsoleHandler) if err != nil { fmt.Println(err) return } - // Start the loop. + // Start the loop. if err := reader.Start(); err != nil { fmt.Println(err) return } - // Set the filter to receive all events. You can use a more fine grained filter if you wish. + // Set the filter to receive all events. You can use a more fine grained filter if you wish. reader.WriteMessage(websocket.TextMessage, []byte(`{"send-everything":true}`)) fmt.Println("Listening for events. Press Ctrl+C to stop.") - // Wait for the context to be done. + // Wait for the context to be done. <-ctx.Done() } ```