gen

Gen generates efficient web routing source code and documentation from annotations

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 shell 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

nginx-proxy

nginx-proxy

Automated nginx proxy for Docker containers using docker-gen ...

docker-gen

docker-gen

Generate files from docker container meta-data ...

l20n.js

l20n.js

A next-gen localization framework from Mozilla. ...

gen

gen

Type-driven code generation for Go ...

lycheejs

lycheejs

:seedling: Next-Gen Isomorphic Application Engine for Embedded, Console, Mobile, Server and Desktop ...