Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #7280
Closed
Open
Issue created Aug 24, 2020 by Administrator@rootContributor

[REQ] Improve go-gin-server template

Created by: ash-r1

Hi, I'm gopher, as others already mentioned, go-gin-server has several issues. I want to make points clear in this issue and discuss it.

Below is my suggestion as a gopher.

  • Locate source codes on the root (instead of under go directory)
  • Use separated package for controller or model.
  • Controller's implementation which based on request/response definition.
    • Bind body with shouldBind or get parameter with getParam etc...
    • Return success/error with the corresponding HTTP status and response body.
  • Defined routes with basic methods. Do not use the weird Route struct.
  • (Advanced) Add controller struct and define action methods for struct pointers.
    • By using controller struct, it's easier to initialize middleware in server bootstrapping.

I have my custom generator to achieve these points on my local already. I can refine it and make a PullReq if someone needs it.

Is it should have the same name or another? go-gin-server2?

Please give me advice and opinion.

I think it's related to #1931 and #2752, #2803. But I filed this issue because these are somewhat outdated.

Assignee
Assign to
Time tracking