Last active
February 26, 2023 09:36
-
-
Save lmllrjr/383e53060edb1ff3798b7877dc3ae3c0 to your computer and use it in GitHub Desktop.
Example gRPC proto file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
syntax = "proto3"; | |
// https://github.com/protocolbuffers/protobuf/blob/c0bd3dd984399d3302a8f7cf69e7c9330b362ac4/src/google/protobuf/timestamp.proto#L133-L144 | |
import "google/protobuf/timestamp.proto"; | |
option go_package = "github.com/<user>/<repo>/pkg/pb"; | |
package pb; | |
// The profile service definition | |
service Profile { | |
rpc GetProfile (GetProfileRequest) returns (GetProfileReply); | |
} | |
message GetProfileRequest { | |
string instance_id = 1; | |
string profile_id = 2; | |
} | |
message GetProfileReply { | |
ProfileData profile = 1; | |
Error error = 2; | |
} | |
message ProfileData { | |
string id = 2; | |
string email = 3; | |
google.protobuf.Timestamp created_at = 4; | |
google.protobuf.Timestamp updated_at = 5; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment