TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: FastAPI like controllers for Gin based Go apps

1 pointsby krsoninikhil12 months ago
Motivation: I should be able to write following handler &#x2F; controller similar to FastAPI by just defining SpecificRequest and SpecificResponse i.e. get request body type as argument and return response type along with error:<p>func myHandler(ctx context.Context, request SpecificRequest) (*SpecificResponse, error) {}<p>Exposing simple CRUD APIs is as simple as following<p>- Ensure your model implements crud.Model, you can embed pgdb.BaseModel to get default implementation for few methods.<p>- Define your request and response types and have them implement crud.Request and crud.Response interfaces.<p>- Add routes specifying your request, response and model types

no comments

no comments