feat(goctl/rpc): support external proto imports with cross-package ty… (#5472)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
kesonan
2026-03-22 12:01:20 +08:00
committed by GitHub
parent c12c82b2f6
commit 004995f06a
93 changed files with 4871 additions and 270 deletions

View File

@@ -0,0 +1,37 @@
syntax = "proto3";
// 场景06import google/protobuf/timestamp.proto (well-known type)
// 预期goctl 正常运行well-known type 的 pb.go 不会被重复生成(跳过)
package eventsvc;
option go_package = "example.com/demo/eventsvc";
import "google/protobuf/timestamp.proto";
message Event {
string id = 1;
string name = 2;
google.protobuf.Timestamp created_at = 3;
}
message CreateEventReq {
string name = 1;
}
message CreateEventReply {
Event event = 1;
}
message ListEventsReq {
int32 page = 1;
int32 size = 2;
}
message ListEventsReply {
repeated Event events = 1;
}
service EventService {
rpc CreateEvent(CreateEventReq) returns (CreateEventReply);
rpc ListEvents(ListEventsReq) returns (ListEventsReply);
}