There's no need to create a heartbeat endpoint, with gRPC
you could just use the grpc-health-probe
You can use either of two tools grpcurl
or the web equivalent grpcUI
(similar to postman but you cannot store the collection, but you can keep the request data as a .json
file
go get github.com/fullstorydev/grpcurl/...
go get github.com/fullstorydev/grpcui/...
PROJECT_ROOT=/home/jovyan/
URI=<URI>
SVC=pb.yourService
PORT=80
WEBUIPORT=8080
# CLI
cat $PROJECT_ROOT/scripts/example_request.json |
grpcurl \
-plaintext \
-d @ \
-import-path $PROJECT_ROOT/symbolic_schemas/vendor \
-import-path $PROJECT_ROOT/symbolic_schemas/protos \
-import-path $PROJECT_ROOT/pb \
-proto $PROJECT_ROOT/pb/yourproto.proto \
$URI:$PORT ${SVC}/Predict
# web UI
# grpcui \
# --plaintext \
# -bind 0.0.0.0 -port $WEBUIPORT \
# -import-path $PROJECT_ROOT/symbolic_schemas/vendor \
# -import-path $PROJECT_ROOT/symbolic_schemas/protos/ \
# -import-path $PROJECT_ROOT/pb \
# -proto $PROJECT_ROOT/pb/yourproto.proto \
# $URI:$PORT