A Go code generator for grpc
Go Gen Tools is a code generation tool that can automate repetitive tasks during application development. It provides a simple command-line interface that you can use to generate code files from templates or schema definitions.
This section list any major frameworks/libraries used to bootstrap project.
Prerequisites Before you start using Go Gen Tools, make sure that you have the following software installed on your computer:
To install Go Gen Tools, you need to run the following command in your terminal or command prompt:
go get github.com/duyledat197/[email protected]
Generate sql:
make gen-sql
Generate proto:
make gen-proto
Generate constract:
make gen-contract
Generate layer by DDD (delivery, service, repository):
make gen-layer
Generate mock:
make gen-mock
.
├── LICENSE
├── Makefile
├── README.md
├── SECURITY.md
├── api
│ ├── contracts
│ │ └── store.sol
│ └── proto
│ ├── cobra
│ │ └── example.proto
│ ├── enum.proto
│ ├── hub.proto
│ ├── nats
│ │ ├── example.proto
│ │ ├── example_test.proto
│ │ └── nrpc.proto
│ ├── options
│ │ ├── annotations.pb.go
│ │ ├── annotations.proto
│ │ └── doc.go
│ ├── search.proto
│ ├── team.proto
│ └── user.proto
├── cmd
│ ├── cmd.go
│ ├── gateway.go
│ ├── inventory.go
│ ├── order.go
│ ├── root.go
│ ├── srv
│ │ └── main.go
│ ├── srv.go
│ └── thirdParty.go
├── config
│ └── config.go
├── database
│ ├── migrations
│ │ ├── 0001_migrate.up.sql
│ │ ├── 0002_migrate.up.sql
│ │ └── 0003_migrate.up.sql
│ └── queries
│ ├── hub.sql
│ ├── team.sql
│ └── user.sql
├── deployments
│ └── helms
│ ├── common.config.yaml
│ ├── configs
│ │ └── insfras.yaml
│ ├── gateway
│ │ ├── Chart.yaml
│ │ ├── charts
│ │ ├── templates
│ │ │ ├── NOTES.txt
│ │ │ ├── _helpers.tpl
│ │ │ ├── configmap.yaml
│ │ │ ├── deployment.yaml
│ │ │ ├── hpa.yaml
│ │ │ ├── ingress.yaml
│ │ │ ├── secrets.yaml
│ │ │ ├── service.yaml
│ │ │ ├── serviceaccount.yaml
│ │ │ └── tests
│ │ │ └── test-connection.yaml
│ │ └── values.yaml
│ ├── inventory
│ │ ├── Chart.yaml
│ │ ├── charts
│ │ ├── templates
│ │ │ ├── NOTES.txt
│ │ │ ├── _helpers.tpl
│ │ │ ├── deployment.yaml
│ │ │ ├── hpa.yaml
│ │ │ ├── ingress.yaml
│ │ │ ├── service.yaml
│ │ │ ├── serviceaccount.yaml
│ │ │ └── tests
│ │ │ └── test-connection.yaml
│ │ └── values.yaml
│ ├── order
│ │ ├── Chart.yaml
│ │ ├── charts
│ │ ├── templates
│ │ │ ├── NOTES.txt
│ │ │ ├── _helpers.tpl
│ │ │ ├── deployment.yaml
│ │ │ ├── hpa.yaml
│ │ │ ├── ingress.yaml
│ │ │ ├── service.yaml
│ │ │ ├── serviceaccount.yaml
│ │ │ └── tests
│ │ │ └── test-connection.yaml
│ │ └── values.yaml
│ └── third_party
│ ├── Chart.yaml
│ ├── charts
│ ├── templates
│ │ ├── NOTES.txt
│ │ ├── _helpers.tpl
│ │ ├── deployment.yaml
│ │ ├── hpa.yaml
│ │ ├── ingress.yaml
│ │ ├── service.yaml
│ │ ├── serviceaccount.yaml
│ │ └── tests
│ │ └── test-connection.yaml
│ └── values.yaml
├── developments
│ ├── Dockerfile
│ ├── abi.Dockerfile
│ ├── bdd_test.Dockerfile
│ ├── docker-compose.yml
│ ├── gen-abi.sh
│ ├── gen-proto.sh
│ ├── proto.Dockerfile
│ ├── sqlc.yaml
│ └── start.sh
├── docs
│ ├── html
│ │ └── index.html
│ ├── markdown
│ │ └── docs.md
│ └── swagger
│ └── *.swagger.json
├── features
│ └── bdd.go
├── go.mod
├── go.sum
├── idl
│ ├── abi
│ │ ├── *.abi
│ │ └── *.go
│ └── pb
│ ├── cobra_pb
│ │ └── ...
│ ├── nats_pb
│ │ └── ...
│ └── ...
├── intergration_test.go
├── internal
│ ├── deliveries
│ │ ├── grpc
│ │ │ ├── hub.go
│ │ │ ├── search.go
│ │ │ ├── team.go
│ │ │ └── user.go
│ │ ├── http
│ │ └── ws
│ │ ├── client.go
│ │ ├── hub.go
│ │ └── ws.go
│ ├── models
│ │ ├── db.go
│ │ ├── hub.sql.go
│ │ ├── models.go
│ │ ├── querier.go
│ │ ├── team.sql.go
│ │ └── user.sql.go
│ ├── mongo
│ │ └── user.go
│ ├── repositories
│ │ ├── hub.go
│ │ ├── mongo
│ │ │ ├── hub.go
│ │ │ ├── team.go
│ │ │ └── user.go
│ │ ├── options.go
│ │ ├── postgres
│ │ │ ├── hub.go
│ │ │ ├── team.go
│ │ │ └── user.go
│ │ ├── team.go
│ │ └── user.go
│ └── services
│ ├── hub.go
│ ├── hub_test.go
│ ├── search.go
│ ├── team.go
│ └── user.go
├── pkg
│ ├── elastic_client
│ │ └── elastic.go
│ ├── eth_client
│ │ ├── balance.go
│ │ ├── client.go
│ │ ├── keystore.go
│ │ ├── transaction.go
│ │ └── wallet.go
│ ├── grpc_client
│ │ ├── grpc.go
│ │ └── option.go
│ ├── grpc_server
│ │ ├── grpc.go
│ │ ├── health_check.go
│ │ └── middleware.go
│ ├── http_server
│ │ ├── http.go
│ │ ├── middleware.go
│ │ └── middleware_test.go
│ ├── hystrix
│ │ └── config.go
│ ├── kafka
│ │ ├── consumer.go
│ │ ├── consumer_group.go
│ │ ├── producer.go
│ │ ├── producer_test.go
│ │ ├── publisher.go
│ │ └── subscriber.go
│ ├── mongo_client
│ │ └── mongo.go
│ ├── nrpc
│ │ ├── nrpc.go
│ │ └── nrpc.pb.go
│ ├── postgres_client
│ │ └── postgres.go
│ ├── prometheus_server
│ │ └── server.go
│ ├── pubsub
│ │ ├── model.go
│ │ ├── publisher.go
│ │ └── subscriber.go
│ ├── ratelimit
│ │ └── ratelimit.go
│ ├── redis_client
│ │ └── redis.go
│ ├── registry
│ │ ├── client.go
│ │ └── register.go
│ ├── swagger_server
│ │ └── server.go
│ └── tracing
│ └── client.go
├── third_party
│ ├── aws
│ │ ├── aws.go
│ │ └── s3.go
│ ├── email
│ │ └── email.go
│ ├── marketing
│ │ └── marketing.go
│ └── sms
│ └── sms.go
├── tools
│ ├── gen-layer
│ │ ├── internal
│ │ │ ├── generator.go
│ │ │ └── step.go
│ │ ├── main.go
│ │ ├── models
│ │ │ ├── cli_step.go
│ │ │ ├── feature.go
│ │ │ └── template.go
│ │ ├── templates
│ │ │ ├── cucumber
│ │ │ │ ├── create.tpl
│ │ │ │ ├── delete.tpl
│ │ │ │ ├── list.tpl
│ │ │ │ ├── retrieve.tpl
│ │ │ │ └── update.tpl
│ │ │ ├── delivery
│ │ │ │ ├── create.tpl
│ │ │ │ ├── default.tpl
│ │ │ │ ├── delete.tpl
│ │ │ │ ├── list.tpl
│ │ │ │ ├── retrieve.tpl
│ │ │ │ └── update.tpl
│ │ │ ├── godog
│ │ │ │ ├── create.tpl
│ │ │ │ ├── default.tpl
│ │ │ │ ├── delete.tpl
│ │ │ │ ├── function.tpl
│ │ │ │ ├── list.tpl
│ │ │ │ ├── retrieve.tpl
│ │ │ │ └── update.tpl
│ │ │ ├── mongo
│ │ │ │ ├── create.tpl
│ │ │ │ ├── default.tpl
│ │ │ │ ├── delete.tpl
│ │ │ │ ├── list.tpl
│ │ │ │ ├── retrieve.tpl
│ │ │ │ └── update.tpl
│ │ │ ├── postgres
│ │ │ │ ├── create.tpl
│ │ │ │ ├── default.tpl
│ │ │ │ ├── delete.tpl
│ │ │ │ ├── list.tpl
│ │ │ │ ├── retrieve.tpl
│ │ │ │ └── update.tpl
│ │ │ ├── repository
│ │ │ │ └── default.tpl
│ │ │ └── service
│ │ │ ├── create.tpl
│ │ │ ├── default.tpl
│ │ │ ├── delete.tpl
│ │ │ ├── list.tpl
│ │ │ ├── retrieve.tpl
│ │ │ └── update.tpl
│ │ └── utils
│ │ ├── parser
│ │ │ └── parser.go
│ │ └── steps.go
│ ├── gen-service
│ ├── protoc-gen-custom
│ │ ├── internal
│ │ │ └── generator.go
│ │ └── main.go
│ └── protoc-gen-nrpc
│ ├── internal
│ │ └── genrator.go
│ ├── main.go
│ └── templates
│ └── nrpc.tpl
├── transform
│ └── ...
└── utils
├── authenticate
│ ├── authenticator.go
│ ├── jwt.go
│ ├── jwt_test.go
│ ├── paseto.go
│ ├── paseto_test.go
│ ├── payload.go
│ └── token.go
├── crypto
│ ├── sha256.go
│ └── sha256_test.go
├── helper
│ ├── validation.go
│ └── validation_test.go
├── ip.go
├── logger
│ └── zap.go
├── metadata
│ └── metadata.go
├── otp
│ ├── hotp.go
│ ├── otp.go
│ └── totp.go
├── pathutils
│ └── path.go
├── string.go
├── token.go
└── transformhelpers
└── helpers.go
Make sure you have Go installed (download). Version 1.19
or higher is required.
Install make for start the server.
For Linux:
sudo apt install make
For Macos:
brew install make
First of all, you must start postgres:
make start-postgres
After that should migrate:
make migrate
Start server with cmd/terminal:
make run
Start server with docker:
make docker-start
Run all test:
make test
install graphviz:
$ go get -u github.com/google/pprof
$ apt-get install graphviz gv // for linux/debian
$ brew install graphviz (mac) // for mac
MIT
Free Software, Hell Yeah!