Skip to content

Commit

Permalink
Update Event interface code doc
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Doherty <[email protected]>
  • Loading branch information
chrisdoherty4 committed Oct 24, 2023
1 parent 75b4200 commit 064c6aa
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion internal/agent/event/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 064c6aa

Please sign in to comment.