summaryrefslogtreecommitdiff
path: root/grpc
diff options
context:
space:
mode:
authormustiikhalil <mustii@mmk.one>2020-08-22 22:39:09 +0300
committerGitHub <noreply@github.com>2020-08-22 22:39:09 +0300
commiteeacc53d227038ae404562806f9440b13d594d51 (patch)
treeecc79e431f8bf1eb8040acab5ae1009dbdb163cb /grpc
parentf3003e08d02ca4810924a53ca463a8b3150926d8 (diff)
downloadflatbuffers-eeacc53d227038ae404562806f9440b13d594d51.tar.gz
flatbuffers-eeacc53d227038ae404562806f9440b13d594d51.tar.bz2
flatbuffers-eeacc53d227038ae404562806f9440b13d594d51.zip
Adds proper access types for swift object api & flatbuffers & grpc (#6081)
Fixes accessor in greeter.swift Small fix for ci
Diffstat (limited to 'grpc')
-rw-r--r--grpc/src/compiler/schema_interface.h1
-rw-r--r--grpc/src/compiler/swift_generator.cc4
2 files changed, 3 insertions, 2 deletions
diff --git a/grpc/src/compiler/schema_interface.h b/grpc/src/compiler/schema_interface.h
index 444b864d..c03ffe7a 100644
--- a/grpc/src/compiler/schema_interface.h
+++ b/grpc/src/compiler/schema_interface.h
@@ -81,6 +81,7 @@ struct Service : public CommentHolder {
virtual std::vector<grpc::string> namespace_parts() const = 0;
virtual grpc::string name() const = 0;
+ virtual bool is_internal() const = 0;
virtual int method_count() const = 0;
virtual std::unique_ptr<const Method> method(int i) const = 0;
diff --git a/grpc/src/compiler/swift_generator.cc b/grpc/src/compiler/swift_generator.cc
index 87332011..a7979fe6 100644
--- a/grpc/src/compiler/swift_generator.cc
+++ b/grpc/src/compiler/swift_generator.cc
@@ -125,7 +125,7 @@ void GenerateClientClass(const grpc_generator::Service *service,
printer->Print("\t\tself.defaultCallOptions = defaultCallOptions\n");
printer->Print("\t}");
printer->Print("\n");
- vars["GenAccess"] = "public";
+ vars["GenAccess"] = service->is_internal() ? "internal" : "public";
for (auto it = 0; it < service->method_count(); it++) {
auto method = service->method(it);
vars["Input"] = GenerateMessage(method->get_input_namespace_parts(), method->get_input_type_name());
@@ -259,7 +259,7 @@ grpc::string Generate(grpc_generator::File *file,
if (!file->package().empty()) { vars["PATH"].append("."); }
vars["ServiceQualifiedName"] = WrapInNameSpace(service->namespace_parts(), service->name());
vars["ServiceName"] = service->name();
- vars["ACCESS"] = "public";
+ vars["ACCESS"] = service->is_internal() ? "internal" : "public";
auto printer = file->CreatePrinter(&output);
printer->Print(vars,
"/// Usage: instantiate $ServiceQualifiedName$ServiceClient, then call "