From 7b89ba813e0c14c3b5164e53e806a6cf15d12585 Mon Sep 17 00:00:00 2001 From: Prabhjot Singh Sethi Date: Thu, 26 Jun 2025 14:38:58 +0530 Subject: [PATCH] Create grpc_server.go --- model/grpc_server.go | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 model/grpc_server.go diff --git a/model/grpc_server.go b/model/grpc_server.go new file mode 100644 index 0000000..c7da400 --- /dev/null +++ b/model/grpc_server.go @@ -0,0 +1,25 @@ +// Copyright © 2025 Prabhjot Singh Sethi, All Rights reserved +// Author: Prabhjot Singh Sethi + +package model + +import ( + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "google.golang.org/grpc" +) + +type GrpcServerContext struct { + // GRPC server handle, over which the grpc server is hosted, + // This handle will be used by the service providers to plumb + // newly created GRPC server handlers + Server *grpc.Server + + // GRPC gateway mux handle, used to register the GRPC gateway + // http handle as per the grpc gateway spec, with under neath + // Endpoint registered catching http requests on the server + Mux *runtime.ServeMux + + // GRPC client handle typically to the above grpc server itself + // required by GRPC gateway to plumb between server and mux + Conn *grpc.ClientConn +}