This demo is about to demonstrate how to use protobuf and protovalidate with REST API written in go.
To generate the go files for the protobuf definitions you need buf
installed.
To generate the go files to pkg/proto/demo/v1
for the protobuf definitions located under proto/demo/v1
run:
buf generate
Start http server with:
go run cmd/server/main.go
Then request the server with:
curl -XPOST --json '{}' localhost:8080/customer
The following CRUD routes are available:
GET localhost:8080/customer
POST localhost:8080/customer
GET localhost:8080/customer/{id}
PUT localhost:8080/customer/{id}
DELETE localhost:8080/customer/{id}