Discover Packages
github.com/wzshiming/gen
module
Version:
v0.2.9
Opens a new window with list of versions in this module.
Published: Jun 20, 2019
License: MIT
Opens a new window with license information.
README
README
¶
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
Examples
Install gen tool go get -v github.com/wzshiming/gen/cmd/gen
Add gen tool to $PATH
Start it gen run github.com/wzshiming/gen-examples/service/...
Open http://127.0.0.1:8080/swagger/?url=./openapi.json# with your browser
Examples
Or try to quickly build services from scratch
Make a directory mkdir -p $(go env GOPATH)/src/gentest
Change directory cd $(go env GOPATH)/src/gentest/
Define models
cat > models.go <<EOF
package gentest
type Gentest struct {
Name string \`json:"name"\`
Age int \`json:"age"\`
}
EOF
Generated from CRUD template gen crud -t mock -n Gentest
Start it gen run gentest
Supported
Generate documentation
RESTful
Generate Go router
Security
apiKey
http
oauth2
openIdConnet
Content
Query
Path
Header
Cookie
Body
JSON
XML
Formdata
URLEncode
Generate Go client
Security
apiKey
http
oauth2
openIdConnet
Content
Query
Path
Header
Cookie
Body
JSON
XML
Formdata
URLEncode
Other Client
gRPC & Proto3
License
Pouch is licensed under the MIT License. See LICENSE for the full license text.
Expand ▾
Collapse ▴
Directories
¶
cmd
Click to show internal directories.
Click to hide internal directories.