You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+15-12Lines changed: 15 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
# Server & Client Template in Golang (gRPC/protobuf)
4
4
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"**.
6
6
7
7
# Initial Setup
8
8
@@ -11,10 +11,14 @@ This repository provides server & client boilerplate codes written in golang. Th
11
11
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.
12
12
4. Merge the `PR` named `Initial Setup`.
13
13
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
+
```
14
18
15
19
# What can you do with initial setup?
16
20
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`.
18
22
19
23
# What should you do after initial setup?
20
24
@@ -30,25 +34,25 @@ You can simply ping from a client to server with a dummy message via `DummyServi
30
34
|
31
35
|-- cmd
32
36
| |-- client -- (D)(1)
33
-
| |
37
+
| |
34
38
| |-- server -- (D)(2)
35
-
| |
39
+
| |
36
40
| `-- tools -- (D)(3)
37
-
|
38
-
|
41
+
|
42
+
|
39
43
|-- internal -- (D)(4)
40
-
|
44
+
|
41
45
|-- model -- (D)(5)
42
-
|
43
-
|-- pkg
46
+
|
47
+
|-- pkg
44
48
| |-- pbs -- (D)(6)
45
49
| |
46
50
| `-- serv -- (D)(7)
47
51
|
48
52
`-- Makefile -- (F)(8)
49
53
```
50
54
51
-
*(D) indicates `Directory`, and (F) indicated `File`*
55
+
_(D) indicates `Directory`, and (F) indicated `File`_
52
56
53
57
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.
54
58
@@ -64,7 +68,6 @@ You can simply ping from a client to server with a dummy message via `DummyServi
64
68
65
69
6.`pkg/pbs` contains protocol buffer related stuff. Usually files with the extensions of `*.proto`, `*.pb.go` should be stored in here.
66
70
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.
68
72
69
73
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`.
0 commit comments