👓 Structuring code samples for GAPIC client libraries
This shows examples of code samples configured to demonstrate calls to 1 rpc call for a given API service.
👓 Structuring code samples for GAPIC client libraries
This shows examples of code samples configured to demonstrate calls to 1 rpc call for a given API service.
| samples: | |
| - sample_id: transcribe_audio_file | |
| description: Transcribe an audio file | |
| type: SINGLE_RPC | |
| api_method: | |
| full_rpc: google.cloud.speech.v1.Speech.Recognize | |
| api_request: | |
| fields: | |
| config: |
This contains scripts which support the following:
create_dog – Create dog with provided namelist_dogs – List all dog namesdelete_dog – Delete dog with provided nameThese scripts demonstrate the sampletester tool.
See related section in the TESTING_GUIDE here:
| // I could use a class and whatnot. | |
| // Maybe later. | |
| // Just making it work. | |
| // | |
| // Interface: sendMessage({ message }, (response) => {}) | |
| // listenForMessages((message, sendResponse) => {}) | |
| // | |
| var __messagingPort__ = null | |
| const __messagingPortName__ = "OkCupidExtension" |
Yes, I did.
The Who Likes You page SUCKS to manage.
So you want to write a partial helper, eh?
Hand-written code adds all kinds of functionality on top of generated GAPIC client libraries!
Let's look at the most common type of hand-written extension:
>> Helper Methods added to service object which wraps call to 1 rpc method <<
🔬 potential source material for a simple gRPC/GAPIC codelab
This sample contains:
| File | Description |
|---|---|
dogs.proto |
Defines dogs API, e.g. rpc methods to create/list/delete dogs |
dogs_server.js |
Node.js implementation of the defined dogs API, e.g. implements the create/list/delete dogs methods |