2
0
Эх сурвалжийг харах

Merge pull request #114 from takasek/final_class

Finalize classes
Tim Burks 7 жил өмнө
parent
commit
1a03984aeb

+ 11 - 11
Examples/Echo/Generated/echo.grpc.swift

@@ -34,7 +34,7 @@ internal enum Echo_EchoClientError : Error {
 }
 
 /// Get (Unary)
-internal class Echo_EchoGetCall {
+internal final class Echo_EchoGetCall {
   private var call : Call
 
   /// Create a call.
@@ -91,7 +91,7 @@ internal class Echo_EchoGetCall {
 }
 
 /// Expand (Server Streaming)
-internal class Echo_EchoExpandCall {
+internal final class Echo_EchoExpandCall {
   private var call : Call
 
   /// Create a call.
@@ -155,7 +155,7 @@ internal class Echo_EchoExpandCall {
 }
 
 /// Collect (Client Streaming)
-internal class Echo_EchoCollectCall {
+internal final class Echo_EchoCollectCall {
   private var call : Call
 
   /// Create a call.
@@ -222,7 +222,7 @@ internal class Echo_EchoCollectCall {
 }
 
 /// Update (Bidirectional Streaming)
-internal class Echo_EchoUpdateCall {
+internal final class Echo_EchoUpdateCall {
   private var call : Call
 
   /// Create a call.
@@ -302,7 +302,7 @@ internal class Echo_EchoUpdateCall {
 }
 
 /// Call methods of this class to make API calls.
-internal class Echo_EchoService {
+internal final class Echo_EchoService {
   public var channel: Channel
 
   /// This metadata will be sent with all requests.
@@ -390,7 +390,7 @@ internal protocol Echo_EchoProvider {
 }
 
 /// Common properties available in each service session.
-internal class Echo_EchoSession {
+internal final class Echo_EchoSession {
   fileprivate var handler : gRPC.Handler
   internal var requestMetadata : Metadata { return handler.requestMetadata }
 
@@ -405,7 +405,7 @@ internal class Echo_EchoSession {
 }
 
 // Get (Unary)
-internal class Echo_EchoGetSession : Echo_EchoSession {
+internal final class Echo_EchoGetSession : Echo_EchoSession {
   private var provider : Echo_EchoProvider
 
   /// Create a session.
@@ -430,7 +430,7 @@ internal class Echo_EchoGetSession : Echo_EchoSession {
 }
 
 // Expand (Server Streaming)
-internal class Echo_EchoExpandSession : Echo_EchoSession {
+internal final class Echo_EchoExpandSession : Echo_EchoSession {
   private var provider : Echo_EchoProvider
 
   /// Create a session.
@@ -472,7 +472,7 @@ internal class Echo_EchoExpandSession : Echo_EchoSession {
 }
 
 // Collect (Client Streaming)
-internal class Echo_EchoCollectSession : Echo_EchoSession {
+internal final class Echo_EchoCollectSession : Echo_EchoSession {
   private var provider : Echo_EchoProvider
 
   /// Create a session.
@@ -521,7 +521,7 @@ internal class Echo_EchoCollectSession : Echo_EchoSession {
 }
 
 // Update (Bidirectional Streaming)
-internal class Echo_EchoUpdateSession : Echo_EchoSession {
+internal final class Echo_EchoUpdateSession : Echo_EchoSession {
   private var provider : Echo_EchoProvider
 
   /// Create a session.
@@ -584,7 +584,7 @@ internal class Echo_EchoUpdateSession : Echo_EchoSession {
 
 
 /// Main server for generated service
-internal class Echo_EchoServer {
+internal final class Echo_EchoServer {
   private var address: String
   private var server: gRPC.Server
   private var provider: Echo_EchoProvider?

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 1 - 1
Plugin/Sources/protoc-gen-swiftgrpc/templates.swift


+ 1 - 1
Plugin/Templates/client-call-bidistreaming.swift

@@ -1,5 +1,5 @@
 /// {{ method|methodDescriptorName }} (Bidirectional Streaming)
-{{ access }} class {{ .|call:file,service,method }} {
+{{ access }} final class {{ .|call:file,service,method }} {
   private var call : Call
 
   /// Create a call.

+ 1 - 1
Plugin/Templates/client-call-clientstreaming.swift

@@ -1,5 +1,5 @@
 /// {{ method|methodDescriptorName }} (Client Streaming)
-{{ access }} class {{ .|call:file,service,method }} {
+{{ access }} final class {{ .|call:file,service,method }} {
   private var call : Call
 
   /// Create a call.

+ 1 - 1
Plugin/Templates/client-call-serverstreaming.swift

@@ -1,5 +1,5 @@
 /// {{ method|methodDescriptorName }} (Server Streaming)
-{{ access }} class {{ .|call:file,service,method }} {
+{{ access }} final class {{ .|call:file,service,method }} {
   private var call : Call
 
   /// Create a call.

+ 1 - 1
Plugin/Templates/client-call-unary.swift

@@ -1,5 +1,5 @@
 /// {{ method|methodDescriptorName }} (Unary)
-{{ access }} class {{ .|call:file,service,method }} {
+{{ access }} final class {{ .|call:file,service,method }} {
   private var call : Call
 
   /// Create a call.

+ 1 - 1
Plugin/Templates/client.swift

@@ -22,7 +22,7 @@
 //-{% endif %}
 //-{% endfor %}
 /// Call methods of this class to make API calls.
-{{ access }} class {{ .|serviceclass:file,service }} {
+{{ access }} final class {{ .|serviceclass:file,service }} {
   public var channel: Channel
 
   /// This metadata will be sent with all requests.

+ 1 - 1
Plugin/Templates/server-session-bidistreaming.swift

@@ -1,5 +1,5 @@
 // {{ method|methodDescriptorName }} (Bidirectional Streaming)
-{{ access }} class {{ .|session:file,service,method }} : {{ .|service:file,service }}Session {
+{{ access }} final class {{ .|session:file,service,method }} : {{ .|service:file,service }}Session {
   private var provider : {{ .|provider:file,service }}
 
   /// Create a session.

+ 1 - 1
Plugin/Templates/server-session-clientstreaming.swift

@@ -1,5 +1,5 @@
 // {{ method|methodDescriptorName }} (Client Streaming)
-{{ access }} class {{ .|session:file,service,method }} : {{ .|service:file,service }}Session {
+{{ access }} final class {{ .|session:file,service,method }} : {{ .|service:file,service }}Session {
   private var provider : {{ .|provider:file,service }}
 
   /// Create a session.

+ 1 - 1
Plugin/Templates/server-session-serverstreaming.swift

@@ -1,5 +1,5 @@
 // {{ method|methodDescriptorName }} (Server Streaming)
-{{ access }} class {{ .|session:file,service,method }} : {{ .|service:file,service }}Session {
+{{ access }} final class {{ .|session:file,service,method }} : {{ .|service:file,service }}Session {
   private var provider : {{ .|provider:file,service }}
 
   /// Create a session.

+ 1 - 1
Plugin/Templates/server-session-unary.swift

@@ -1,5 +1,5 @@
 // {{ method|methodDescriptorName }} (Unary)
-{{ access }} class {{ .|session:file,service,method }} : {{ .|service:file,service }}Session {
+{{ access }} final class {{ .|session:file,service,method }} : {{ .|service:file,service }}Session {
   private var provider : {{ .|provider:file,service }}
 
   /// Create a session.

+ 2 - 2
Plugin/Templates/server.swift

@@ -24,7 +24,7 @@
 }
 
 /// Common properties available in each service session.
-{{ access }} class {{ .|service:file,service }}Session {
+{{ access }} final class {{ .|service:file,service }}Session {
   fileprivate var handler : gRPC.Handler
   {{ access }} var requestMetadata : Metadata { return handler.requestMetadata }
 
@@ -54,7 +54,7 @@
 //-{% endfor %}
 
 /// Main server for generated service
-{{ access }} class {{ .|server:file,service }} {
+{{ access }} final class {{ .|server:file,service }} {
   private var address: String
   private var server: gRPC.Server
   private var provider: {{ .|provider:file,service }}?

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно