gen

Gen generates efficient web routing source code and documentation from annotations

1 month after

Gen - Tools for generating source code for microservices

Just write normal functions, and Gen generates efficient routing source code and documentation for it Because the source code is generated, none of this affects runtime performance
The differences caused by each change in the tool are shown directly in the generated source code
generating clients is also supported

Build Status Go Report Card GitHub license

Examples

  1. Install gen tool go get -v github.com/wzshiming/gen/cmd/gen
  2. Add gen tool to $PATH
  3. Start it gen run github.com/wzshiming/gen-examples/service/...
  4. Open http://127.0.0.1:8080/swagger/?url=./openapi.json# with your browser

Examples

Or try to quickly build services from scratch

  1. Make a directory mkdir -p $(go env GOPATH)/src/gentest
  2. Change directory cd $(go env GOPATH)/src/gentest/
  3. Define models
    cat > models.go <<EOF
    package gentest
    type Gentest struct {
    Name string \`json:"name"\`
    Age  int    \`json:"age"\`
    }
    EOF
  4. Generated from CRUD template gen crud -t mock -n Gentest
  5. Start it gen run gentest

Supported

  • [X] Generate documentation
  • [X] RESTful
    • [X] Generate Go router
    • [X] Security
      • [X] apiKey
      • [X] http
      • [X] basic
      • [ ] bearer
      • [ ] oauth2
      • [ ] openIdConnet
    • [X] Content
      • [X] Query
      • [X] Path
      • [X] Header
      • [X] Cookie
      • [X] Body
      • [X] JSON
      • [ ] XML
      • [ ] Formdata
        • [X] File
        • [ ] Value
      • [ ] URLEncode
    • [X] Generate Go client
    • [X] Security
      • [X] apiKey
      • [X] http
      • [X] basic
      • [X] bearer
      • [ ] oauth2
      • [ ] openIdConnet
    • [X] Content
      • [X] Query
      • [X] Path
      • [X] Header
      • [X] Cookie
      • [X] Body
      • [X] JSON
      • [X] XML
      • [X] Formdata
        • [X] File
        • [X] Value
      • [ ] URLEncode
    • Javascript client
    • Other language client
  • [ ] gRPC & Proto3

License

Pouch is licensed under the MIT License. See LICENSE for the full license text.

Related Repositories

docker-gen

docker-gen

Generate files from docker container meta-data ...

ptc-acc-gen

ptc-acc-gen

PTC Account Gen [Supported once again] ...

laravel-dot-env-gen

laravel-dot-env-gen

generates a .env.gen file based on the existing project source code. Analises fo ...

ptc-acc-gen

ptc-acc-gen

PTC Account Gen (formerly by Seb) [Supported once again] ...

gen-plugin-export

gen-plugin-export

Build audio applications and plugins with gen~ ...