[grpc-python][experimental] Accessing service from imported protos using grpc.services

8 views
Skip to first unread message

Shripal Gandhi

unread,
Aug 22, 2024, 2:31:46 PMAug 22
to grpc.io
Hi,

For below main.proto file:

syntax = "proto3";

package helloworld;

import "test.proto";

service Greeter_main {
  rpc SayHello (HelloRequest) returns (HelloReply) {}
}

And test.proto as:

syntax = "proto3";

package helloworld;

service Greeter_test {
  rpc SayHello (HelloRequest) returns (HelloReply) {}
}
message HelloRequest {
  string name = 1;
}

message HelloReply {
  string message = 1;
}
import grpc.experimental
protos, services = grpc.protos_and_services("main.proto")
dir(services)

Service Greeter_main, Greeter_mainStub is accessible, but not Greeter_test and Greeter_testStub. Is there a way Greeter_testStub can be accessed? Or point to document that would be helpful. Couldn't find any article, hence reaching out here.

Thank you in advance.

From,
Shripal Gandhi
Reply all
Reply to author
Forward
0 new messages