Build gRPC services with Go - protobuf, streaming, interceptors
View on GitHubpluginagentmarketplace/custom-plugin-go
go-development-assistant
January 21, 2026
Select agents to install to:
npx add-skill https://github.com/pluginagentmarketplace/custom-plugin-go/blob/main/skills/go-grpc/SKILL.md -a claude-code --skill go-grpcInstallation paths:
.claude/skills/go-grpc/# Go gRPC Skill
Build high-performance gRPC services with Go.
## Overview
Complete guide for gRPC development including protobuf design, streaming, interceptors, and error handling.
## Parameters
| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| streaming | string | no | "unary" | Type: "unary", "server", "client", "bidi" |
| auth | string | no | "none" | Auth: "none", "jwt", "mtls" |
## Core Topics
### Protobuf Definition
```protobuf
syntax = "proto3";
package api.v1;
option go_package = "github.com/example/api/v1;apiv1";
service UserService {
rpc GetUser(GetUserRequest) returns (GetUserResponse);
rpc ListUsers(ListUsersRequest) returns (stream User);
rpc CreateUser(CreateUserRequest) returns (CreateUserResponse);
}
message User {
int64 id = 1;
string name = 2;
string email = 3;
google.protobuf.Timestamp created_at = 4;
}
```
### Server Implementation
```go
type userServer struct {
apiv1.UnimplementedUserServiceServer
store UserStore
}
func (s *userServer) GetUser(ctx context.Context, req *apiv1.GetUserRequest) (*apiv1.GetUserResponse, error) {
user, err := s.store.FindByID(ctx, req.Id)
if err != nil {
if errors.Is(err, ErrNotFound) {
return nil, status.Error(codes.NotFound, "user not found")
}
return nil, status.Error(codes.Internal, "internal error")
}
return &apiv1.GetUserResponse{
User: toProtoUser(user),
}, nil
}
func (s *userServer) ListUsers(req *apiv1.ListUsersRequest, stream apiv1.UserService_ListUsersServer) error {
users, err := s.store.List(stream.Context(), req.PageSize)
if err != nil {
return status.Error(codes.Internal, "failed to list users")
}
for _, user := range users {
if err := stream.Send(toProtoUser(user)); err != nil {
return err
}
}
return nil
}
```
### Interceptors
```go
func LoggingInterceptor(logger *sl