liveBook · Manning

Generation

As explained in Learn Go with Pocket-Sized Projects

A response message is a Protobuf message containing the output data for an API operation.

A response message carries the output data for an API operation. In a gRPC service, define it as a dedicated Protobuf message, even when it currently contains only one field or is empty. section 10.1.1

Dedicated request and response messages preserve version compatibility: later fields such as a user token or habit identifier can be added without breaking clients written against the earlier API. section 10.1.1

CreateHabit response

The CreateHabit endpoint accepts CreateHabitRequest and returns CreateHabitResponse. The response contains a Habit field, leaving room for additional output fields in later versions. section 10.1.1

How Learn Go with Pocket-Sized Projects covers it

How deep it goes
Explains dedicated message declarations and compatibility rationale, stopping short of generated implementation details.
Examples
Uses the CreateHabit endpoint with CreateHabitRequest and CreateHabitResponse containing a Habit field.
What it assumes
Assumes familiarity with services and endpoints while defining Protobuf message structure through the CreateHabit example.
What you can do after
Build it from scratch by declaring version-tolerant Protobuf responses for gRPC endpoints.
How it connects
Connects response messages with Protobuf, gRPC, service definitions, request messages, and API versioning.

Also explained in

Compare how 20 books explain generation →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Learn Go with Pocket-Sized Projects. The section links point to the parts of the book it draws on.