This repo contains a small example CLI that calls the Google Cloud Translate API with Sidecar and IO.
You'll need a Google Cloud project and service credentials, but once you have that, the rest is easy:
$ make
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
mkdir -p genproto
protoc proto/google/cloud/translate/v3/translation_service.proto \
--proto_path='proto' \
--go_opt='module=github.com/agentio/translate-io/genproto' \
--go_opt=Mgoogle/cloud/translate/v3/translation_service.proto=github.com/agentio/translate-io/genproto/translatepb \
--go_out='genproto'
go install ./...
$ translate-io --parent projects/agentio "I just called a Google gRPC API"
{
"translations": [
{
"translatedText": "Acabo de llamar a una API gRPC de Google"
}
]
}
In the example above, my project is agentio.
IO configuration is in the io directory.