Table of Contents

Class GatewayService

Namespace
Virtufin.Api.Services
Assembly
Virtufin.Api.dll

Implementation of the gRPC Gateway service. Provides service discovery and method invocation. Event subscription (Gateway.Subscribe) was never added to gateway.proto -- Pubsub.Subscribe (see PubsubService) is the only subscribe path; this class previously held unused constructor dependencies (DaprPublishSubscribeClient, TopicDaprSubscriptionRegistry, GatewaySubscriptionManager) left over from that never-implemented design.

public class GatewayService : Gateway.GatewayBase
Inheritance
Gateway.GatewayBase
GatewayService
Inherited Members

Constructors

GatewayService(GrpcReflectionService, ServicesConfiguration, ILogger<GatewayService>, DaprResiliencePipeline)

Creates a new GatewayService instance.

public GatewayService(GrpcReflectionService reflectionService, ServicesConfiguration config, ILogger<GatewayService> logger, DaprResiliencePipeline resilience)

Parameters

reflectionService GrpcReflectionService

The gRPC reflection service for method discovery.

config ServicesConfiguration

The services configuration containing registered services.

logger ILogger<GatewayService>

The logger for recording service events.

resilience DaprResiliencePipeline

The Dapr resilience pipeline for wrapping gateway invocations.

Methods

GetMethodSchema(GetMethodSchemaRequest, ServerCallContext)

Gets the schema for a specific method including input/output types and field definitions.

public override Task<GetMethodSchemaResponse> GetMethodSchema(GetMethodSchemaRequest request, ServerCallContext context)

Parameters

request GetMethodSchemaRequest

The get method schema request containing service, method, and schema type.

context ServerCallContext

The server call context.

Returns

Task<GetMethodSchemaResponse>

The method schema including field definitions.

Invoke(InvokeRequest, ServerCallContext)

Invokes a method on a backend service using raw protobuf bytes.

public override Task<InvokeResponse> Invoke(InvokeRequest request, ServerCallContext context)

Parameters

request InvokeRequest

The invoke request containing service name, method name, and request data.

context ServerCallContext

The server call context.

Returns

Task<InvokeResponse>

The invoke response containing success status and response data.

InvokeJson(InvokeJsonRequest, ServerCallContext)

Invokes a method on a backend service using JSON request/response data. This is the recommended method for most use cases.

public override Task<InvokeJsonResponse> InvokeJson(InvokeJsonRequest request, ServerCallContext context)

Parameters

request InvokeJsonRequest

The invoke JSON request containing service name, method name, and JSON request data.

context ServerCallContext

The server call context.

Returns

Task<InvokeJsonResponse>

The invoke JSON response containing success status and JSON response data.

ListMethods(ListMethodsRequest, ServerCallContext)

Lists all methods available for a specific service.

public override Task<ListMethodsResponse> ListMethods(ListMethodsRequest request, ServerCallContext context)

Parameters

request ListMethodsRequest

The list methods request containing the service name.

context ServerCallContext

The server call context.

Returns

Task<ListMethodsResponse>

A list of method descriptors.

ListServices(ListServicesRequest, ServerCallContext)

Lists all services registered with the gateway.

public override Task<ListServicesResponse> ListServices(ListServicesRequest request, ServerCallContext context)

Parameters

request ListServicesRequest

The list services request.

context ServerCallContext

The server call context.

Returns

Task<ListServicesResponse>

A list of service names.