The C based gRPC (C++, Python, Ruby, Objective-C, PHP, C#) https://grpc.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

156 lines
9.1 KiB

10 years ago
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: route_guide.proto
#region Designer generated code
using System;
using System.Threading;
using System.Threading.Tasks;
using Grpc.Core;
namespace Examples {
10 years ago
public static class RouteGuide
{
static readonly string __ServiceName = "examples.RouteGuide";
static readonly Marshaller<global::Examples.Point> __Marshaller_Point = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Examples.Point.Parser.ParseFrom);
static readonly Marshaller<global::Examples.Feature> __Marshaller_Feature = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Examples.Feature.Parser.ParseFrom);
static readonly Marshaller<global::Examples.Rectangle> __Marshaller_Rectangle = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Examples.Rectangle.Parser.ParseFrom);
static readonly Marshaller<global::Examples.RouteSummary> __Marshaller_RouteSummary = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Examples.RouteSummary.Parser.ParseFrom);
static readonly Marshaller<global::Examples.RouteNote> __Marshaller_RouteNote = Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Examples.RouteNote.Parser.ParseFrom);
10 years ago
static readonly Method<global::Examples.Point, global::Examples.Feature> __Method_GetFeature = new Method<global::Examples.Point, global::Examples.Feature>(
10 years ago
MethodType.Unary,
__ServiceName,
10 years ago
"GetFeature",
__Marshaller_Point,
__Marshaller_Feature);
static readonly Method<global::Examples.Rectangle, global::Examples.Feature> __Method_ListFeatures = new Method<global::Examples.Rectangle, global::Examples.Feature>(
10 years ago
MethodType.ServerStreaming,
__ServiceName,
10 years ago
"ListFeatures",
__Marshaller_Rectangle,
__Marshaller_Feature);
static readonly Method<global::Examples.Point, global::Examples.RouteSummary> __Method_RecordRoute = new Method<global::Examples.Point, global::Examples.RouteSummary>(
10 years ago
MethodType.ClientStreaming,
__ServiceName,
10 years ago
"RecordRoute",
__Marshaller_Point,
__Marshaller_RouteSummary);
static readonly Method<global::Examples.RouteNote, global::Examples.RouteNote> __Method_RouteChat = new Method<global::Examples.RouteNote, global::Examples.RouteNote>(
10 years ago
MethodType.DuplexStreaming,
__ServiceName,
10 years ago
"RouteChat",
__Marshaller_RouteNote,
__Marshaller_RouteNote);
// service descriptor
public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
{
get { return global::Examples.Proto.RouteGuide.Descriptor.Services[0]; }
}
// client interface
10 years ago
public interface IRouteGuideClient
{
global::Examples.Feature GetFeature(global::Examples.Point request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
global::Examples.Feature GetFeature(global::Examples.Point request, CallOptions options);
AsyncUnaryCall<global::Examples.Feature> GetFeatureAsync(global::Examples.Point request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
AsyncUnaryCall<global::Examples.Feature> GetFeatureAsync(global::Examples.Point request, CallOptions options);
AsyncServerStreamingCall<global::Examples.Feature> ListFeatures(global::Examples.Rectangle request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
AsyncServerStreamingCall<global::Examples.Feature> ListFeatures(global::Examples.Rectangle request, CallOptions options);
AsyncClientStreamingCall<global::Examples.Point, global::Examples.RouteSummary> RecordRoute(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
AsyncClientStreamingCall<global::Examples.Point, global::Examples.RouteSummary> RecordRoute(CallOptions options);
AsyncDuplexStreamingCall<global::Examples.RouteNote, global::Examples.RouteNote> RouteChat(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken));
AsyncDuplexStreamingCall<global::Examples.RouteNote, global::Examples.RouteNote> RouteChat(CallOptions options);
10 years ago
}
// server-side interface
public interface IRouteGuide
{
Task<global::Examples.Feature> GetFeature(global::Examples.Point request, ServerCallContext context);
Task ListFeatures(global::Examples.Rectangle request, IServerStreamWriter<global::Examples.Feature> responseStream, ServerCallContext context);
Task<global::Examples.RouteSummary> RecordRoute(IAsyncStreamReader<global::Examples.Point> requestStream, ServerCallContext context);
Task RouteChat(IAsyncStreamReader<global::Examples.RouteNote> requestStream, IServerStreamWriter<global::Examples.RouteNote> responseStream, ServerCallContext context);
10 years ago
}
// client stub
public class RouteGuideClient : ClientBase, IRouteGuideClient
10 years ago
{
public RouteGuideClient(Channel channel) : base(channel)
{
}
public global::Examples.Feature GetFeature(global::Examples.Point request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{
var call = CreateCall(__Method_GetFeature, new CallOptions(headers, deadline, cancellationToken));
return Calls.BlockingUnaryCall(call, request);
}
public global::Examples.Feature GetFeature(global::Examples.Point request, CallOptions options)
10 years ago
{
var call = CreateCall(__Method_GetFeature, options);
return Calls.BlockingUnaryCall(call, request);
10 years ago
}
public AsyncUnaryCall<global::Examples.Feature> GetFeatureAsync(global::Examples.Point request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
10 years ago
{
var call = CreateCall(__Method_GetFeature, new CallOptions(headers, deadline, cancellationToken));
return Calls.AsyncUnaryCall(call, request);
10 years ago
}
public AsyncUnaryCall<global::Examples.Feature> GetFeatureAsync(global::Examples.Point request, CallOptions options)
10 years ago
{
var call = CreateCall(__Method_GetFeature, options);
return Calls.AsyncUnaryCall(call, request);
10 years ago
}
public AsyncServerStreamingCall<global::Examples.Feature> ListFeatures(global::Examples.Rectangle request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
10 years ago
{
var call = CreateCall(__Method_ListFeatures, new CallOptions(headers, deadline, cancellationToken));
return Calls.AsyncServerStreamingCall(call, request);
10 years ago
}
public AsyncServerStreamingCall<global::Examples.Feature> ListFeatures(global::Examples.Rectangle request, CallOptions options)
10 years ago
{
var call = CreateCall(__Method_ListFeatures, options);
return Calls.AsyncServerStreamingCall(call, request);
10 years ago
}
public AsyncClientStreamingCall<global::Examples.Point, global::Examples.RouteSummary> RecordRoute(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
10 years ago
{
var call = CreateCall(__Method_RecordRoute, new CallOptions(headers, deadline, cancellationToken));
return Calls.AsyncClientStreamingCall(call);
10 years ago
}
public AsyncClientStreamingCall<global::Examples.Point, global::Examples.RouteSummary> RecordRoute(CallOptions options)
10 years ago
{
var call = CreateCall(__Method_RecordRoute, options);
return Calls.AsyncClientStreamingCall(call);
}
public AsyncDuplexStreamingCall<global::Examples.RouteNote, global::Examples.RouteNote> RouteChat(Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{
var call = CreateCall(__Method_RouteChat, new CallOptions(headers, deadline, cancellationToken));
return Calls.AsyncDuplexStreamingCall(call);
}
public AsyncDuplexStreamingCall<global::Examples.RouteNote, global::Examples.RouteNote> RouteChat(CallOptions options)
{
var call = CreateCall(__Method_RouteChat, options);
return Calls.AsyncDuplexStreamingCall(call);
10 years ago
}
}
// creates service definition that can be registered with a server
public static ServerServiceDefinition BindService(IRouteGuide serviceImpl)
{
return ServerServiceDefinition.CreateBuilder(__ServiceName)
.AddMethod(__Method_GetFeature, serviceImpl.GetFeature)
.AddMethod(__Method_ListFeatures, serviceImpl.ListFeatures)
.AddMethod(__Method_RecordRoute, serviceImpl.RecordRoute)
.AddMethod(__Method_RouteChat, serviceImpl.RouteChat).Build();
}
// creates a new client
public static RouteGuideClient NewClient(Channel channel)
10 years ago
{
return new RouteGuideClient(channel);
}
}
}
#endregion