[Swift] Append namespace for Swift Grpc implementation (#6049)

* [Swift] Append namespace for Swift Grpc implementation
* Separate ServiceName from ServiceQualifiedName.
This commit is contained in:
Liu Liu
2020-07-31 00:07:45 -07:00
committed by GitHub
parent 77c18c1d69
commit a0fb30575c
4 changed files with 52 additions and 33 deletions

View File

@@ -59,12 +59,18 @@ class FlatBufMethod : public grpc_generator::Method {
std::string name() const { return method_->name; }
// TODO: This method need to incorporate namespace for C++ side. Other language bindings
// simply don't use this method.
std::string GRPCType(const StructDef &sd) const {
return "flatbuffers::grpc::Message<" + sd.name + ">";
}
std::vector<std::string> get_input_namespace_parts() const { return (*method_->request).defined_namespace->components; }
std::string get_input_type_name() const { return (*method_->request).name; }
std::vector<std::string> get_output_namespace_parts() const { return (*method_->response).defined_namespace->components; }
std::string get_output_type_name() const { return (*method_->response).name; }
bool get_module_and_message_path_input(grpc::string * /*str*/,
@@ -111,6 +117,8 @@ class FlatBufService : public grpc_generator::Service {
return service_->doc_comment;
}
std::vector<grpc::string> namespace_parts() const { return service_->defined_namespace->components; }
std::string name() const { return service_->name; }
int method_count() const {