From b71e4cd992278086e1c7a64be272fd21faf473f0 Mon Sep 17 00:00:00 2001 From: Chris Doherty Date: Tue, 24 Oct 2023 10:54:45 -0500 Subject: [PATCH] Update Event interface code doc Signed-off-by: Chris Doherty --- internal/agent/event/event.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/internal/agent/event/event.go b/internal/agent/event/event.go index 3331beb34..ccc248d68 100644 --- a/internal/agent/event/event.go +++ b/internal/agent/event/event.go @@ -7,7 +7,17 @@ import "context" // Name is a unique name identifying an event. type Name string -// Event is a recordable event. +// Event is a recordable event. Each event in the event package implements this interface. Consumers +// should type switch the Event to the appropriate type for event handling. +// +// E.g. +// +// switch ev.(type) { +// case event.ActionStarted: +// // Handle ActionStarted event. +// default: +// // Unsupported event. +// } type Event interface { // GetName retrieves the event name. GetName() Name