-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
(goctl)feature: supported sse generation #5082
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
Conversation
# Conflicts: # tools/goctl/api/gogen/genroutes.go
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Pull Request Overview
This PR adds Server-Sent Events (SSE) generation support to the goctl tool, allowing automatic generation of SSE-specific handlers and logic templates. The feature introduces conditional template selection based on the "sse" annotation in API specifications.
- Adds SSE-specific templates for handlers and logic components
- Implements conditional logic to generate different code paths for SSE vs standard HTTP handlers
- Updates version to 1.8.6-alpha and fixes a typo in version tags
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| analyzer.go | Adds validation to ensure SSE routes have response types |
| version.go | Updates version to 1.8.6-alpha and fixes "pre-bata" typo |
| template.go | Registers new SSE template files |
| sse_logic.tpl | Template for SSE logic components with channel-based responses |
| sse_handler.tpl | Template for SSE handlers with event streaming logic |
| genlogic.go | Adds conditional SSE logic generation with modified signatures |
| genhandlers.go | Implements SSE handler generation with template selection |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <[email protected]>
No description provided.