Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions proto/trogonai/grpc_nats_micro/v1/echo.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
edition = "2024";

// Reference service for the grpc-nats-micro binding (ADR 0016). It is the
// conformance fixture the binding's integration tests drive, and a worked
// example of a protobuf service annotated for NATS micro. It carries no domain
// meaning.
package trogonai.grpc_nats_micro.v1;

import "google/rpc/code.proto";
import "google/rpc/status.proto";
import "trogon/nats/micro/v1alpha1/options.proto";
Comment thread
coderabbitai[bot] marked this conversation as resolved.

// EchoService is the reference NATS micro service. The binding derives one
// endpoint per rpc; success replies carry the response message, faults carry
// a google.rpc.Status on the micro error channel (ADR 0016 section 3).
service EchoService {
option (trogon.nats.micro.v1alpha1.service) = {version: "1.0.0"};

// Say returns the request message unchanged.
rpc Say(SayRequest) returns (SayResponse);

// Fail always faults, so tests can exercise the google.rpc.Status error
// channel. The requested code is echoed back as the fault's status code.
rpc Fail(FailRequest) returns (FailResponse) {
option (trogon.nats.micro.v1alpha1.method) = {
metadata: {
key: "always-faults"
value: "true"
}
};
Comment thread
coderabbitai[bot] marked this conversation as resolved.
}
}

message SayRequest {
string message = 1;
}

message SayResponse {
string message = 1;
}

message FailRequest {
// Canonical status code the handler should fault with.
google.rpc.Code code = 1;
string message = 2;
}

message FailResponse {
string message = 1;
}
Loading
Loading