Browse Source

Tightened access controls in generated code.

Tim Burks 9 years ago
parent
commit
aa305209e1

+ 5 - 5
Examples/Echo/Swift/Generated/echo.client.pb.swift

@@ -49,7 +49,7 @@ public enum Echo_EchoClientError : Error {
 }
 // Get (Unary)
 public class Echo_EchoGetCall {
-  var call : Call
+  private var call : Call
 
   /// Create a call.
   fileprivate init(_ channel: Channel) {
@@ -87,7 +87,7 @@ public class Echo_EchoGetCall {
 
 // Expand (Server Streaming)
 public class Echo_EchoExpandCall {
-  var call : Call
+  private var call : Call
 
   /// Create a call.
   fileprivate init(_ channel: Channel) {
@@ -135,7 +135,7 @@ public class Echo_EchoExpandCall {
 
 // Collect (Client Streaming)
 public class Echo_EchoCollectCall {
-  var call : Call
+  private var call : Call
 
   /// Create a call.
   fileprivate init(_ channel: Channel) {
@@ -210,7 +210,7 @@ public class Echo_EchoCollectCall {
 
 // Update (Bidirectional Streaming)
 public class Echo_EchoUpdateCall {
-  var call : Call
+  private var call : Call
 
   /// Create a call.
   fileprivate init(_ channel: Channel) {
@@ -332,4 +332,4 @@ public class Echo_EchoService {
   public func update() throws -> Echo_EchoUpdateCall {
     return try Echo_EchoUpdateCall(channel).run(metadata:metadata)
   }
-}
+}

+ 9 - 9
Examples/Echo/Swift/Generated/echo.server.pb.swift

@@ -55,8 +55,8 @@ public protocol Echo_EchoProvider {
 }
 // Get (Unary)
 public class Echo_EchoGetSession {
-  var handler : gRPC.Handler
-  var provider : Echo_EchoProvider
+  private var handler : gRPC.Handler
+  private var provider : Echo_EchoProvider
 
   /// Create a session.
   fileprivate init(handler:gRPC.Handler, provider: Echo_EchoProvider) {
@@ -86,8 +86,8 @@ public class Echo_EchoGetSession {
 
 // Expand (Server Streaming)
 public class Echo_EchoExpandSession {
-  var handler : gRPC.Handler
-  var provider : Echo_EchoProvider
+  private var handler : gRPC.Handler
+  private var provider : Echo_EchoProvider
 
   /// Create a session.
   fileprivate init(handler:gRPC.Handler, provider: Echo_EchoProvider) {
@@ -125,8 +125,8 @@ public class Echo_EchoExpandSession {
 
 // Collect (Client Streaming)
 public class Echo_EchoCollectSession {
-  var handler : gRPC.Handler
-  var provider : Echo_EchoProvider
+  private var handler : gRPC.Handler
+  private var provider : Echo_EchoProvider
 
   /// Create a session.
   fileprivate init(handler:gRPC.Handler, provider: Echo_EchoProvider) {
@@ -179,8 +179,8 @@ public class Echo_EchoCollectSession {
 
 // Update (Bidirectional Streaming)
 public class Echo_EchoUpdateSession {
-  var handler : gRPC.Handler
-  var provider : Echo_EchoProvider
+  private var handler : gRPC.Handler
+  private var provider : Echo_EchoProvider
 
   /// Create a session.
   fileprivate init(handler:gRPC.Handler, provider: Echo_EchoProvider) {
@@ -248,7 +248,7 @@ public class Echo_EchoUpdateSession {
 public class Echo_EchoServer {
   private var address: String
   private var server: gRPC.Server
-  public var provider: Echo_EchoProvider?
+  private var provider: Echo_EchoProvider?
 
   /// Create a server that accepts insecure connections.
   public init(address:String,

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

@@ -1,6 +1,6 @@
 // {{ method.name }} (Bidirectional Streaming)
 public class {{ .|call:protoFile,service,method }} {
-  var call : Call
+  private var call : Call
 
   /// Create a call.
   fileprivate init(_ channel: Channel) {

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

@@ -1,6 +1,6 @@
 // {{ method.name }} (Client Streaming)
 public class {{ .|call:protoFile,service,method }} {
-  var call : Call
+  private var call : Call
 
   /// Create a call.
   fileprivate init(_ channel: Channel) {

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

@@ -1,6 +1,6 @@
 // {{ method.name }} (Server Streaming)
 public class {{ .|call:protoFile,service,method }} {
-  var call : Call
+  private var call : Call
 
   /// Create a call.
   fileprivate init(_ channel: Channel) {

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

@@ -1,6 +1,6 @@
 // {{ method.name }} (Unary)
 public class {{ .|call:protoFile,service,method }} {
-  var call : Call
+  private var call : Call
 
   /// Create a call.
   fileprivate init(_ channel: Channel) {

+ 1 - 1
Plugin/templates/client.pb.swift

@@ -123,4 +123,4 @@ public class {{ protoFile.package|capitalize }}_{{ service.name }}Service {
   //-{% endif %}
   //-{% endfor %}
 }
-//-{% endfor %}
+//-{% endfor %}

+ 2 - 2
Plugin/templates/server-session-bidistreaming.swift

@@ -1,7 +1,7 @@
 // {{ method.name }} (Bidirectional Streaming)
 public class {{ .|session:protoFile,service,method }} {
-  var handler : gRPC.Handler
-  var provider : {{ .|provider:protoFile,service }}
+  private var handler : gRPC.Handler
+  private var provider : {{ .|provider:protoFile,service }}
 
   /// Create a session.
   fileprivate init(handler:gRPC.Handler, provider: {{ .|provider:protoFile,service }}) {

+ 2 - 2
Plugin/templates/server-session-clientstreaming.swift

@@ -1,7 +1,7 @@
 // {{ method.name }} (Client Streaming)
 public class {{ .|session:protoFile,service,method }} {
-  var handler : gRPC.Handler
-  var provider : {{ .|provider:protoFile,service }}
+  private var handler : gRPC.Handler
+  private var provider : {{ .|provider:protoFile,service }}
 
   /// Create a session.
   fileprivate init(handler:gRPC.Handler, provider: {{ .|provider:protoFile,service }}) {

+ 2 - 2
Plugin/templates/server-session-serverstreaming.swift

@@ -1,7 +1,7 @@
 // {{ method.name }} (Server Streaming)
 public class {{ .|session:protoFile,service,method }} {
-  var handler : gRPC.Handler
-  var provider : {{ .|provider:protoFile,service }}
+  private var handler : gRPC.Handler
+  private var provider : {{ .|provider:protoFile,service }}
 
   /// Create a session.
   fileprivate init(handler:gRPC.Handler, provider: {{ .|provider:protoFile,service }}) {

+ 2 - 2
Plugin/templates/server-session-unary.swift

@@ -1,7 +1,7 @@
 // {{ method.name }} (Unary)
 public class {{ .|session:protoFile,service,method }} {
-  var handler : gRPC.Handler
-  var provider : {{ .|provider:protoFile,service }}
+  private var handler : gRPC.Handler
+  private var provider : {{ .|provider:protoFile,service }}
 
   /// Create a session.
   fileprivate init(handler:gRPC.Handler, provider: {{ .|provider:protoFile,service }}) {

+ 1 - 1
Plugin/templates/server.pb.swift

@@ -83,7 +83,7 @@ public protocol {{ .|provider:protoFile,service }} {
 public class {{ .|server:protoFile,service }} {
   private var address: String
   private var server: gRPC.Server
-  public var provider: {{ .|provider:protoFile,service }}?
+  private var provider: {{ .|provider:protoFile,service }}?
 
   /// Create a server that accepts insecure connections.
   public init(address:String,