liveBook · Manning

gRPC service

As explained in Learn Go with Pocket-Sized Projects

A gRPC service is a Protocol Buffers declaration that groups remotely callable methods and defines their service interface.

A gRPC service is a Protocol Buffers declaration that groups remotely callable methods and defines their service interface. In a habits tracker, the Habits service organizes operations for registering and tracking habits. section 10.1.1

Define a service incrementally:

  • Compile the declarations with protoc and the Go and gRPC plugins to produce Go implementation interfaces and message types. section 10.1.2

CreateHabit

A service method can accept CreateHabitRequest, containing a name and optional weekly frequency, and return CreateHabitResponse containing the created Habit.

How Learn Go with Pocket-Sized Projects covers it

How deep it goes
Explains declarations, RPC signatures, message imports, and Go generation, but stops short of implementing server behavior.
Examples
Uses a Habits service with a CreateHabit endpoint and Habit, CreateHabitRequest, and CreateHabitResponse messages.
What it assumes
Assumes basic Go module setup and introduces the Protobuf declaration basics needed to define services and messages.
What you can do after
Build it from scratch by declaring a service and compiling its .proto files into Go code.
How it connects
Connects Protocol Buffers, RPC methods, request and response messages, and Go code 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.