Skip to content

Commit 068e87c

Browse files
authored
chore: make PROTOC_VERSION env variable and update README
1 parent bb7b0e0 commit 068e87c

File tree

2 files changed

+16
-13
lines changed

2 files changed

+16
-13
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.DEFAULT_GOAL := all
22

3-
PROTOC_VERSION := 3.17.2
3+
PROTOC_VERSION ?= 3.17.2
44
PROTOC_RELEASE := https://github.com/protocolbuffers/protobuf/releases
55
PROTO_FILES := $(shell find . -name "*.proto" -type f)
66
UNAME := $(shell uname)

README.md

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Server & Client Template in Golang (gRPC/protobuf)
44

5-
This repository provides server & client boilerplate codes written in golang. The server & client communicated via gRPC/protobuf interface. It's boring to fork the repo and replace all the placeholders to fit your own environment. Instead, this repository give an easy way to **"copy"**.
5+
This repository provides server & client boilerplate codes written in golang. The server & client communicated via gRPC/protobuf interface. It's boring to fork the repo and replace all the placeholders to fit your own environment. Instead, this repository give an easy way to **"copy"**.
66

77
# Initial Setup
88

@@ -11,10 +11,14 @@ This repository provides server & client boilerplate codes written in golang. Th
1111
3. When the repository is copied over to your place, a `setup` GitHub Action gets triggered. It essentially leaves a `PR` when it is done.
1212
4. Merge the `PR` named `Initial Setup`.
1313
5. When the `PR` is done merged, it triggers another `ci` GitHub Action. Wait until it ends.
14+
6. Run `make install`. You can also specify PROTOC_VERSION if needed like this:
15+
```shell
16+
PROTOC_VERSION=3.17.0 make install
17+
```
1418

1519
# What can you do with initial setup?
1620

17-
You can simply ping from a client to server with a dummy message via `DummyService`.
21+
You can simply ping from a client to server with a dummy message via `DummyService`.
1822

1923
# What should you do after initial setup?
2024

@@ -30,25 +34,25 @@ You can simply ping from a client to server with a dummy message via `DummyServi
3034
|
3135
|-- cmd
3236
| |-- client -- (D)(1)
33-
| |
37+
| |
3438
| |-- server -- (D)(2)
35-
| |
39+
| |
3640
| `-- tools -- (D)(3)
37-
|
38-
|
41+
|
42+
|
3943
|-- internal -- (D)(4)
40-
|
44+
|
4145
|-- model -- (D)(5)
42-
|
43-
|-- pkg
46+
|
47+
|-- pkg
4448
| |-- pbs -- (D)(6)
4549
| |
4650
| `-- serv -- (D)(7)
4751
|
4852
`-- Makefile -- (F)(8)
4953
```
5054

51-
*(D) indicates `Directory`, and (F) indicated `File`*
55+
_(D) indicates `Directory`, and (F) indicated `File`_
5256

5357
0. Any GitHub Action should go into `.github`. Basic CI workflow is provided. It simply builds `cmd/client/main.go` and `cmd/server/main.go` to check if there is any errors.
5458

@@ -64,7 +68,6 @@ You can simply ping from a client to server with a dummy message via `DummyServi
6468

6569
6. `pkg/pbs` contains protocol buffer related stuff. Usually files with the extensions of `*.proto`, `*.pb.go` should be stored in here.
6670

67-
7. `pkg/serv` is there to handle incoming messages from client to server.
71+
7. `pkg/serv` is there to handle incoming messages from client to server.
6872

6973
8. `Makefile` mainly provides two rules, installing gRPC/protobuf environment via `make install` and generating protobuf into the appropriate folder `pkg/pbs` via `make all`.
70-

0 commit comments

Comments
 (0)