Golang Clean Architetecture
- go to folder
resources
and open fileconfig.json
- Update the value based on your environment
- Clone this repo inside your $GOPATH/src/github.com/vickydk
- Update config.json
- Install all dependency
go mod tidy
- Try run Application Restful API with
make run
and accesshttp://localhost:8811
- Clone this repo inside your $GOPATH/src/github.com/vickydk
- Update config.json
- Install all dependency
go mod tidy
- Try run Application Restful API with
make run-grpc
and accesslocalhost:8822
- Clone this repo inside your $GOPATH/src/github.com/vickydk
- Update config.json
- Install all dependency
go mod tidy
- Try run Application Restful API with
make run-app
- Access
localhost:8822
for GRPC - Access
localhost:8811
for HTTP
Call this url: http://localhost:8811/
, if you see response OK
so the application already run successfully
-
Install
protoc
version 3.17.3- the binary can be found [here](https://github.com/protocolbuffers/protobuf/releases/tag/v3.17.3
- download it and put the binary in a folder registered on your
$PATH
or/usr/local/bin
- run
protoc --version
should return protoclibprotoc 3.17.3
-
Install dependency library
- go get -u google.golang.org/grpc
- go get -u github.com/golang/protobuf/{proto,protoc-gen-go}
- go install github.com/golang/protobuf/protoc-gen-go@latest // if cannot install line 17
- go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
- go get -u github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc
- go to folder
pkg/shared/grpc
- run this command to compile the proto file
./protoc.sh -p {protofile_name_without.dot.proto
, for example./protoc.sh -p user
gorsk is licensed under the MIT license. Check the LICENSE file for details.