https://github.com/dkrizic/todo
Go Service and client based on Protobuf
https://github.com/dkrizic/todo
docker go grpc multiarch protobuf rest
Last synced: 2 months ago
JSON representation
Go Service and client based on Protobuf
- Host: GitHub
- URL: https://github.com/dkrizic/todo
- Owner: dkrizic
- Created: 2022-11-29T13:28:24.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-11-13T23:24:40.000Z (almost 2 years ago)
- Last Synced: 2025-03-24T03:08:57.812Z (7 months ago)
- Topics: docker, go, grpc, multiarch, protobuf, rest
- Language: Go
- Homepage:
- Size: 396 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ToDo List
Sample project that includes the following features:
* Go programming language
* CRUD service offering a simple ToDo list
* Interface is defined via protobuf
* Protoc generates
* gRPC Server
* REST Gateway
* Swagger documentationSo in summary the service offers a REST API and a gRPC API from a single definition.
The code is compiled for* amd64
* arm64and available as a Multiaarch Docker image under the following tags:
```
ghcr.io/dkrizic/todo-server:latest
```## API
The directory /api contains the protobuf definition of the API
```
todo.proto
```All other files are generated or downloaded. The generated can be updated running
```
./update
```The generated files are commited
## Server
The server is implemented in Go and can be found in the directory /server
It can be locally run using```
$ go run server.go
INFO[0000] Creating new server
INFO[0000] Serving gRPC on :8080
INFO[0000] Service HTTP on :8090
INFO[0035] Creating new todo id=d93f5341-071b-462b-af6e-d397aafbe206 title="Another todo"
INFO[0035] Getting all todos count=1
```### Backends
The server can be configured to use different backends. The default is a simple in-memory backend. More backends to come.
### Ports
The following ports are used
* 8080 - gRPC
* 8090 - REST## Client
The client user the gRPC API to create and list todos
```
$ go run client.go
INFO[0000] Starting app
INFO[0000] Got todo id=d93f5341-071b-462b-af6e-d397aafbe206 title="Another todo"
```