Skip to content
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

router: type-safe helpers for multiplex routes #131

Open
1 task done
unknwon opened this issue Jun 4, 2022 · 1 comment
Open
1 task done

router: type-safe helpers for multiplex routes #131

unknwon opened this issue Jun 4, 2022 · 1 comment
Assignees
Labels
🎯 feature Categorizes as related to a new feature 🔆 roadmap This is on our roadmap!

Comments

@unknwon
Copy link
Member

unknwon commented Jun 4, 2022

Component

Core framework

Middleware

n/a

Is your feature request related to a problem? Please describe

Currently multiplex routes are supported via:

f.Routes("/", http.MethodGet, http.MethodPost, <my handlers>)

// or

f.Routes("/", "GET,POST", ...)

But neither of are both elegant and type-safe.

Describe the solution you'd like

Something like

f.RoutePath("/").Methods(http.MethodGet, http.MethodPost).Handlers(...)

Describe alternatives you've considered

Live with it

Additional context

Derived from #113 (comment)

Code of Conduct

  • I agree to follow this project's Code of Conduct
@unknwon
Copy link
Member Author

unknwon commented Jun 9, 2022

Related in terms of underlying types: #132

@unknwon unknwon added the 🔆 roadmap This is on our roadmap! label Jun 9, 2022
@unknwon unknwon self-assigned this Jun 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎯 feature Categorizes as related to a new feature 🔆 roadmap This is on our roadmap!
Projects
Status: No status
Development

No branches or pull requests

1 participant