-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Event interface code doc #825
Conversation
b93e04b
to
064c6aa
Compare
Codecov Report
@@ Coverage Diff @@
## main #825 +/- ##
=======================================
Coverage 51.16% 51.16%
=======================================
Files 33 33
Lines 1456 1456
=======================================
Hits 745 745
Misses 665 665
Partials 46 46 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
064c6aa
to
b71e4cd
Compare
internal/agent/event/event.go
Outdated
@@ -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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great, thanks. A few suggestions for things to add that I think would be helpful for implementors.
- what "recordable event" is, means, and when/where events are recorded (i believe its just in the agent logic).
- transports implementations are responsible for sending the event.
- concrete event types will contain more context that can be used when sending an event.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can add something for the first 2. Isn't the third point covered by the comment on how to use and the example?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tweaked this a little but I decided not to make any mention of transport because thats 1 of possibly more consumers. I think the documentation in this package needs to be tight and relevant to the package itself.
We could add documentation elsewhere that strings everything together but I don't think its appropriate for this interface.
735333c
to
63dc88e
Compare
63dc88e
to
4690177
Compare
4690177
to
715370d
Compare
Signed-off-by: Chris Doherty <[email protected]>
715370d
to
946b93c
Compare
The
Event
interface is implemented by all events. The code docs were not clear on how a consumer leverages theEvent
interface to handle the event (for example transport the event).This code doc clarifies the intended usage of the Event interface.