Skip to content

Commit

Permalink
update proto
Browse files Browse the repository at this point in the history
  • Loading branch information
yilei committed Apr 30, 2020
1 parent b97ace8 commit d44744c
Show file tree
Hide file tree
Showing 5 changed files with 114 additions and 47 deletions.
60 changes: 36 additions & 24 deletions examples/CodeFirst/MathClient/grpc_gen_code/MathGrpc.serviceGrpc.cs
Original file line number Diff line number Diff line change
@@ -1,49 +1,49 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: MathGrpc.service.proto
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: MathGrpc.service.proto
// </auto-generated>
#pragma warning disable 0414, 1591
#region Designer generated code

using System;
using System.Threading;
using System.Threading.Tasks;
using grpc = global::Grpc.Core;

namespace MathGrpc {
public static partial class MathGrpc
{
static readonly string __ServiceName = "MathGrpc";
static readonly string __ServiceName = "math.MathGrpc";

static readonly grpc::Marshaller<global::MathGrpc.AddRequest> __Marshaller_AddRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::MathGrpc.AddRequest.Parser.ParseFrom);
static readonly grpc::Marshaller<global::MathGrpc.IntMessage> __Marshaller_IntMessage = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::MathGrpc.IntMessage.Parser.ParseFrom);
static readonly grpc::Marshaller<global::MathGrpc.SubRequest> __Marshaller_SubRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::MathGrpc.SubRequest.Parser.ParseFrom);
static readonly grpc::Marshaller<global::MathGrpc.SumRequest> __Marshaller_SumRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::MathGrpc.SumRequest.Parser.ParseFrom);
static readonly grpc::Marshaller<global::MathGrpc.AddRequest> __Marshaller_math_AddRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::MathGrpc.AddRequest.Parser.ParseFrom);
static readonly grpc::Marshaller<global::MathGrpc.IntMessage> __Marshaller_math_IntMessage = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::MathGrpc.IntMessage.Parser.ParseFrom);
static readonly grpc::Marshaller<global::MathGrpc.SubRequest> __Marshaller_math_SubRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::MathGrpc.SubRequest.Parser.ParseFrom);
static readonly grpc::Marshaller<global::MathGrpc.SumRequest> __Marshaller_math_SumRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::MathGrpc.SumRequest.Parser.ParseFrom);

static readonly grpc::Method<global::MathGrpc.AddRequest, global::MathGrpc.IntMessage> __Method_Add = new grpc::Method<global::MathGrpc.AddRequest, global::MathGrpc.IntMessage>(
grpc::MethodType.Unary,
__ServiceName,
"Add",
__Marshaller_AddRequest,
__Marshaller_IntMessage);
__Marshaller_math_AddRequest,
__Marshaller_math_IntMessage);

static readonly grpc::Method<global::MathGrpc.SubRequest, global::MathGrpc.IntMessage> __Method_Sub = new grpc::Method<global::MathGrpc.SubRequest, global::MathGrpc.IntMessage>(
grpc::MethodType.Unary,
__ServiceName,
"Sub",
__Marshaller_SubRequest,
__Marshaller_IntMessage);
__Marshaller_math_SubRequest,
__Marshaller_math_IntMessage);

static readonly grpc::Method<global::MathGrpc.SumRequest, global::MathGrpc.IntMessage> __Method_Sum = new grpc::Method<global::MathGrpc.SumRequest, global::MathGrpc.IntMessage>(
grpc::MethodType.ClientStreaming,
__ServiceName,
"Sum",
__Marshaller_SumRequest,
__Marshaller_IntMessage);
__Marshaller_math_SumRequest,
__Marshaller_math_IntMessage);

static readonly grpc::Method<global::MathGrpc.SumRequest, global::MathGrpc.IntMessage> __Method_SumServerStream = new grpc::Method<global::MathGrpc.SumRequest, global::MathGrpc.IntMessage>(
grpc::MethodType.ServerStreaming,
__ServiceName,
"SumServerStream",
__Marshaller_SumRequest,
__Marshaller_IntMessage);
__Marshaller_math_SumRequest,
__Marshaller_math_IntMessage);

/// <summary>Service descriptor</summary>
public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
Expand Down Expand Up @@ -132,7 +132,7 @@ protected MathGrpcClient(ClientBaseConfiguration configuration) : base(configura
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The response received from the server.</returns>
public virtual global::MathGrpc.IntMessage Add(global::MathGrpc.AddRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
public virtual global::MathGrpc.IntMessage Add(global::MathGrpc.AddRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return Add(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
Expand All @@ -154,7 +154,7 @@ protected MathGrpcClient(ClientBaseConfiguration configuration) : base(configura
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The call object.</returns>
public virtual grpc::AsyncUnaryCall<global::MathGrpc.IntMessage> AddAsync(global::MathGrpc.AddRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
public virtual grpc::AsyncUnaryCall<global::MathGrpc.IntMessage> AddAsync(global::MathGrpc.AddRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return AddAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
Expand All @@ -176,7 +176,7 @@ protected MathGrpcClient(ClientBaseConfiguration configuration) : base(configura
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The response received from the server.</returns>
public virtual global::MathGrpc.IntMessage Sub(global::MathGrpc.SubRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
public virtual global::MathGrpc.IntMessage Sub(global::MathGrpc.SubRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return Sub(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
Expand All @@ -198,7 +198,7 @@ protected MathGrpcClient(ClientBaseConfiguration configuration) : base(configura
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The call object.</returns>
public virtual grpc::AsyncUnaryCall<global::MathGrpc.IntMessage> SubAsync(global::MathGrpc.SubRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
public virtual grpc::AsyncUnaryCall<global::MathGrpc.IntMessage> SubAsync(global::MathGrpc.SubRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return SubAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
Expand All @@ -219,7 +219,7 @@ protected MathGrpcClient(ClientBaseConfiguration configuration) : base(configura
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The call object.</returns>
public virtual grpc::AsyncClientStreamingCall<global::MathGrpc.SumRequest, global::MathGrpc.IntMessage> Sum(grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
public virtual grpc::AsyncClientStreamingCall<global::MathGrpc.SumRequest, global::MathGrpc.IntMessage> Sum(grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return Sum(new grpc::CallOptions(headers, deadline, cancellationToken));
}
Expand All @@ -240,7 +240,7 @@ protected MathGrpcClient(ClientBaseConfiguration configuration) : base(configura
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The call object.</returns>
public virtual grpc::AsyncServerStreamingCall<global::MathGrpc.IntMessage> SumServerStream(global::MathGrpc.SumRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
public virtual grpc::AsyncServerStreamingCall<global::MathGrpc.IntMessage> SumServerStream(global::MathGrpc.SumRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return SumServerStream(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
Expand Down Expand Up @@ -272,6 +272,18 @@ protected override MathGrpcClient NewInstance(ClientBaseConfiguration configurat
.AddMethod(__Method_SumServerStream, serviceImpl.SumServerStream).Build();
}

/// <summary>Register service method with a service binder with or without implementation. Useful when customizing the service binding logic.
/// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary>
/// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param>
/// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
public static void BindService(grpc::ServiceBinderBase serviceBinder, MathGrpcBase serviceImpl)
{
serviceBinder.AddMethod(__Method_Add, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::MathGrpc.AddRequest, global::MathGrpc.IntMessage>(serviceImpl.Add));
serviceBinder.AddMethod(__Method_Sub, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::MathGrpc.SubRequest, global::MathGrpc.IntMessage>(serviceImpl.Sub));
serviceBinder.AddMethod(__Method_Sum, serviceImpl == null ? null : new grpc::ClientStreamingServerMethod<global::MathGrpc.SumRequest, global::MathGrpc.IntMessage>(serviceImpl.Sum));
serviceBinder.AddMethod(__Method_SumServerStream, serviceImpl == null ? null : new grpc::ServerStreamingServerMethod<global::MathGrpc.SumRequest, global::MathGrpc.IntMessage>(serviceImpl.SumServerStream));
}

}
}
#endregion
Loading

0 comments on commit d44744c

Please sign in to comment.