module
Version:
v0.0.0-...-755ff5e
Opens a new window with list of versions in this module.
Published: Feb 27, 2022
License: MIT
Opens a new window with license information.
README
¶
Bootstrap template for golang backend service with bazel and grpc/protobuf
Why?
- immediately start a repo for golang based backend service
- demo server and client using grpc/protobuf
- modern toolchain including build system/backend libraries/linter
Demo HTTP server using grpc/protobuf as protocol
Server:
bazel run src/demo/demoserver
Client:
bazel run src/demo/client:client
Library versions
Prerequisite
install golang if you don't have it already
run bash install_prerequisite.sh
to install all prerequisite
add this export PATH=$PATH:$HOME/go/bin
into your .bashrc or .zshrc
Build system and compiler
Syntax |
Version |
Description |
Bazel |
4.2.2 |
Build system, fast and cross language (.bazelversion) |
bazelisk |
N/A |
Manage bazel version for the project |
rules_go |
v0.30.0 |
Golang build rules for bazel (version in WORKSPACE) |
golang |
1.17.7 |
Golang (version in WORKSPACE), note: this golang is for building this project and will not be conflicit with the system one |
Server backend
Lint with pre-commit hook
./lint.sh
to lint everything: BUILD, json, golang, yaml etc
Syntax |
Version |
Description |
pre-commit |
latest |
precommit/lint management |
buildifier |
latest |
lint for BUILD file |
goimports |
latest |
lint for golang file |
golangci-lint |
latest |
Go linters aggregator that runs linters in parallel |
CI/CD
Test
Directories
¶
src
|
|
|
|
|
|
|
|
|
|
Click to show internal directories.
Click to hide internal directories.