Browse Source

Lower-case the names of functions in code generated by the plugin.

Tim Burks 9 years ago
parent
commit
965fa0c02f

+ 6 - 6
Examples/Echo/Generated/echo.client.pb.swift

@@ -107,7 +107,7 @@ public class Echo_EchoExpandCall {
   }
 
   // Call this to wait for a result. Blocks.
-  public func Receive() throws -> Echo_EchoResponse {
+  public func receive() throws -> Echo_EchoResponse {
     var returnError : Echo_EchoClientError?
     var response : Echo_EchoResponse!
     let latch = CountDownLatch(1)
@@ -154,13 +154,13 @@ public class Echo_EchoCollectCall {
   }
 
   // Call this to send each message in the request stream.
-  public func Send(_ message: Echo_EchoRequest) throws {
+  public func send(_ message: Echo_EchoRequest) throws {
     let messageData = try message.serializeProtobuf()
     try call.sendMessage(data:messageData)
   }
 
   // Call this to close the connection and wait for a response. Blocks.
-  public func CloseAndReceive() throws -> Echo_EchoResponse {
+  public func closeAndReceive() throws -> Echo_EchoResponse {
     var returnError : Echo_EchoClientError?
     var returnResponse : Echo_EchoResponse!
     let latch = CountDownLatch(1)
@@ -206,7 +206,7 @@ public class Echo_EchoUpdateCall {
     return self
   }
 
-  public func Receive() throws -> Echo_EchoResponse {
+  public func receive() throws -> Echo_EchoResponse {
     var returnError : Echo_EchoClientError?
     var returnMessage : Echo_EchoResponse!
     let latch = CountDownLatch(1)
@@ -230,12 +230,12 @@ public class Echo_EchoUpdateCall {
     return returnMessage
   }
 
-  public func Send(_ message:Echo_EchoRequest) throws {
+  public func send(_ message:Echo_EchoRequest) throws {
     let messageData = try message.serializeProtobuf()
     try call.sendMessage(data:messageData)
   }
 
-  public func CloseSend() throws {
+  public func closeSend() throws {
     let latch = CountDownLatch(1)
     try call.close() {
       latch.signal()

+ 6 - 6
Examples/Echo/Generated/echo.server.pb.swift

@@ -107,7 +107,7 @@ public class Echo_EchoExpandSession : Echo_EchoSession {
   }
 
   /// Send a message. Nonblocking.
-  public func Send(_ response: Echo_EchoResponse) throws {
+  public func send(_ response: Echo_EchoResponse) throws {
     try handler.sendResponse(message:response.serializeProtobuf()) {}
   }
 
@@ -149,7 +149,7 @@ public class Echo_EchoCollectSession : Echo_EchoSession {
   }
 
   /// Receive a message. Blocks until a message is received or the client closes the connection.
-  public func Receive() throws -> Echo_EchoRequest {
+  public func receive() throws -> Echo_EchoRequest {
     let latch = CountDownLatch(1)
     var requestMessage : Echo_EchoRequest?
     try self.handler.receiveMessage() {(requestData) in
@@ -166,7 +166,7 @@ public class Echo_EchoCollectSession : Echo_EchoSession {
   }
 
   /// Send a response and close the connection.
-  public func SendAndClose(_ response: Echo_EchoResponse) throws {
+  public func sendAndClose(_ response: Echo_EchoResponse) throws {
     try self.handler.sendResponse(message:response.serializeProtobuf(),
                                   statusCode:self.statusCode,
                                   statusMessage:self.statusMessage,
@@ -198,7 +198,7 @@ public class Echo_EchoUpdateSession : Echo_EchoSession {
   }
 
   /// Receive a message. Blocks until a message is received or the client closes the connection.
-  public func Receive() throws -> Echo_EchoRequest {
+  public func receive() throws -> Echo_EchoRequest {
     let latch = CountDownLatch(1)
     var requestMessage : Echo_EchoRequest?
     try self.handler.receiveMessage() {(requestData) in
@@ -220,12 +220,12 @@ public class Echo_EchoUpdateSession : Echo_EchoSession {
   }
 
   /// Send a message. Nonblocking.
-  public func Send(_ response: Echo_EchoResponse) throws {
+  public func send(_ response: Echo_EchoResponse) throws {
     try handler.sendResponse(message:response.serializeProtobuf()) {}
   }
 
   /// Close a connection. Blocks until the connection is closed.
-  public func Close() throws {
+  public func close() throws {
     let latch = CountDownLatch(1)
     try self.handler.sendStatus(statusCode:self.statusCode,
                                 statusMessage:self.statusMessage,

File diff suppressed because it is too large
+ 0 - 0
Plugin/Sources/protoc-gen-swiftgrpc/templates.swift


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

@@ -18,7 +18,7 @@ public class {{ .|call:protoFile,service,method }} {
     return self
   }
 
-  public func Receive() throws -> {{ method|output }} {
+  public func receive() throws -> {{ method|output }} {
     var returnError : {{ .|clienterror:protoFile,service }}?
     var returnMessage : {{ method|output }}!
     let latch = CountDownLatch(1)
@@ -42,12 +42,12 @@ public class {{ .|call:protoFile,service,method }} {
     return returnMessage
   }
 
-  public func Send(_ message:{{ method|input }}) throws {
+  public func send(_ message:{{ method|input }}) throws {
     let messageData = try message.serializeProtobuf()
     try call.sendMessage(data:messageData)
   }
 
-  public func CloseSend() throws {
+  public func closeSend() throws {
     let latch = CountDownLatch(1)
     try call.close() {
       latch.signal()

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

@@ -20,13 +20,13 @@ public class {{ .|call:protoFile,service,method }} {
   }
 
   // Call this to send each message in the request stream.
-  public func Send(_ message: {{ method|input }}) throws {
+  public func send(_ message: {{ method|input }}) throws {
     let messageData = try message.serializeProtobuf()
     try call.sendMessage(data:messageData)
   }
 
   // Call this to close the connection and wait for a response. Blocks.
-  public func CloseAndReceive() throws -> {{ method|output }} {
+  public func closeAndReceive() throws -> {{ method|output }} {
     var returnError : {{ .|clienterror:protoFile,service }}?
     var returnResponse : {{ method|output }}!
     let latch = CountDownLatch(1)

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

@@ -22,7 +22,7 @@ public class {{ .|call:protoFile,service,method }} {
   }
 
   // Call this to wait for a result. Blocks.
-  public func Receive() throws -> {{ method|output }} {
+  public func receive() throws -> {{ method|output }} {
     var returnError : {{ .|clienterror:protoFile,service }}?
     var response : {{ method|output }}!
     let latch = CountDownLatch(1)

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

@@ -9,7 +9,7 @@ public class {{ .|session:protoFile,service,method }} : {{ .|service:protoFile,s
   }
 
   /// Receive a message. Blocks until a message is received or the client closes the connection.
-  public func Receive() throws -> {{ method|input }} {
+  public func receive() throws -> {{ method|input }} {
     let latch = CountDownLatch(1)
     var requestMessage : {{ method|input }}?
     try self.handler.receiveMessage() {(requestData) in
@@ -31,12 +31,12 @@ public class {{ .|session:protoFile,service,method }} : {{ .|service:protoFile,s
   }
 
   /// Send a message. Nonblocking.
-  public func Send(_ response: {{ method|output }}) throws {
+  public func send(_ response: {{ method|output }}) throws {
     try handler.sendResponse(message:response.serializeProtobuf()) {}
   }
 
   /// Close a connection. Blocks until the connection is closed.
-  public func Close() throws {
+  public func close() throws {
     let latch = CountDownLatch(1)
     try self.handler.sendStatus(statusCode:self.statusCode,
                                 statusMessage:self.statusMessage,

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

@@ -9,7 +9,7 @@ public class {{ .|session:protoFile,service,method }} : {{ .|service:protoFile,s
   }
 
   /// Receive a message. Blocks until a message is received or the client closes the connection.
-  public func Receive() throws -> {{ method|input }} {
+  public func receive() throws -> {{ method|input }} {
     let latch = CountDownLatch(1)
     var requestMessage : {{ method|input }}?
     try self.handler.receiveMessage() {(requestData) in
@@ -26,7 +26,7 @@ public class {{ .|session:protoFile,service,method }} : {{ .|service:protoFile,s
   }
 
   /// Send a response and close the connection.
-  public func SendAndClose(_ response: {{ method|output }}) throws {
+  public func sendAndClose(_ response: {{ method|output }}) throws {
     try self.handler.sendResponse(message:response.serializeProtobuf(),
                                   statusCode:self.statusCode,
                                   statusMessage:self.statusMessage,

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

@@ -9,7 +9,7 @@ public class {{ .|session:protoFile,service,method }} : {{ .|service:protoFile,s
   }
 
   /// Send a message. Nonblocking.
-  public func Send(_ response: {{ method|output }}) throws {
+  public func send(_ response: {{ method|output }}) throws {
     try handler.sendResponse(message:response.serializeProtobuf()) {}
   }
 

Some files were not shown because too many files changed in this diff