Files
go-server-with-otel/proto/demo/app/v1alpha1/app.proto
Ryan D McGuire 1759f91cd1
Some checks failed
Build and Publish / check-chart (push) Successful in 15s
Build and Publish / helm-release (push) Has been skipped
Build and Publish / release (push) Failing after 1m10s
fix buf validate, add sample field validation
2025-07-21 16:39:00 -04:00

30 lines
857 B
Protocol Buffer

syntax = "proto3";
package demo.app.v1alpha1;
import "buf/validate/validate.proto";
import "google/api/annotations.proto";
import "google/protobuf/timestamp.proto";
option go_package = "gitea.libretechconsulting.com/rmcguire/go-server-with-otel/api/v1alpha1/demo";
// Options for random fact, in this case
// just a language
message GetDemoRequest {
optional string language = 1 [(buf.validate.field).string.min_len = 2];
}
// Returns a randome fact, because this is a demo app
// so what else do we do?
message GetDemoResponse {
google.protobuf.Timestamp timestamp = 1;
string fact = 2;
string source = 3;
string language = 4 [(buf.validate.field).string.min_len = 2];
}
service DemoAppService {
rpc GetDemo(GetDemoRequest) returns (GetDemoResponse) {
option (google.api.http) = {get: "/v1alpha1/demo"}; // grpc-gateway endpoint
}
}