tetragon
tetragon copied to clipboard
codegen: implement UnwrapGetEventsResponse helper
This commit adds a code generated UnwrapGetEventsResponse helper that returns the inner event type from a GetEventsResponse. This enables us to do type matching directly on the inner event, for example to see whether it implements a particular interface, thus avoiding the need for long and complex switch statements when we only care about one or two possible event types.
In subsequent patches, I will start to refactor existing parts of our codebase to use this new helper. But for now let's get this in as it should be useful in the future as well.
Signed-off-by: William Findlay [email protected]