You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
insanitywholesale f016e462db
run `go get -u -v ./...`
9 months ago
grpc add publisher methods to grpc server 1 year ago
models correct publisher method argument type 1 year ago
openapiv2/v1 upd8 deps; regen protos 1 year ago
proto/v1 apparently grpc-gateway v2 can only be used with buf 1 year ago
repo correct publisher method argument type 1 year ago
rest add missing dependency 1 year ago
testdata some changes to testdata 2 years ago
third_party upd8 third_party 1 year ago
.drone.yml fix redis port in .drone.yml 2 years ago
.gitignore add supporting files 2 years ago
.goreleaser.yml add supporting files 2 years ago
Dockerfile update dockerfile to go 1.17 1 year ago
LICENSE Add LICENSE (forgot to do it previously) 2 years ago
Makefile apparently grpc-gateway v2 can only be used with buf 1 year ago
README.md update README 2 years ago
TODO.md upd8 TODO 2 years ago
buf.gen.yaml apparently grpc-gateway v2 can only be used with buf 1 year ago
buf.lock apparently grpc-gateway v2 can only be used with buf 1 year ago
buf.yaml apparently grpc-gateway v2 can only be used with buf 1 year ago
go.mod run `go get -u -v ./...` 9 months ago
go.sum run `go get -u -v ./...` 9 months ago
main.go big improve 2 years ago
main_test.go update test 2 years ago

README.md

bookdir

directory of books, used to illustrate useful gRPC-related development

explanation

the api is written as a proto file and exposed over grpc and also exposed as a rest api through grpc-gateway

way to quick test

go test

run go test -v and see if it passes

json

get

run go run main.go and do curl http://localhost:8080/api/v1/books to see it in action

post

run go run main.go and use curl -H "Content-Type: application/json" -X POST --data-binary '@testdata/testbook.json' http://localhost:8080/api/v1/book to add a book

configuration

Variable Description Default Value
BOOKDIR_GRPC_PORT grpc port of the service 11000
BOOKDIR_REST_PORT rest port of the service 8080
PG_URL postgres database URL empty
REDIS_URL redis database URL empty