Package Description
$ dotnet add package Common.Messaging.LibThis repository contains all the .proto files required for defining and serializing messaging protocols used in the project. The .proto files are organized by categories and functionalities to support various operations such as event management, API validation, and data serialization.
This repository includes all .proto files necessary for defining messages and services used in the project. These files are used to generate code for both server and client implementations across various services.
The .proto files are organized as follows:
ProtosContains various categories such as:
APIPermissionManagementAccessShield/GetAccessShieldApiKeyValidationBookedEventComparison/WeeklyComparisonCompetitorDataEach directory represents a specific service or feature and may have subdirectories for related operations. For example, the BookedEvent directory contains the following .proto files:
CreateBookedEvent.protoDeleteBookedEvent.protoGetBookedEvent.protoGetBookedEvents.protoUpdateBookedEvent.protoTo use the .proto files in your project, follow these steps:
Clone the repository:
git clone <repository-url>
cd <repository-folder>
Install the required dependencies for protocol buffer compilation:
dotnet add package Google.Protobuf --version 3.29.0-rc2
dotnet add package Grpc.Tools --version 2.67.0
Ensure that your build system is configured to compile .proto files.
You can use protoc or equivalent tools to generate code from .proto files. Example command:
protoc --proto_path=Messaging/Serialization/Protos --csharp_out=GeneratedCode/ Messaging/Serialization/Protos/BookedEvent/CreateBookedEvent.proto.csprojEnsure that your .csproj file includes the .proto files:
<ItemGroup>
<Protobuf Include="Messaging/Serialization/Protos/**/*.proto" />
</ItemGroup>This allows the .proto files to be compiled automatically during the build process.
CreateBookedEvent.protoDefines the message structure for creating a booked event.
syntax = "proto3";
message CreateBookedEvent {
string event_id = 1;
string event_name = 2;
string event_date = 3;
int32 guest_count = 4;
}GetBookedEvent.protoDefines the message structure for retrieving a booked event.
syntax = "proto3";
message GetBookedEventRequest {
string event_id = 1;
}
message GetBookedEventResponse {
string event_id = 1;
string event_name = 2;
string event_date = 3;
int32 guest_count = 4;
}This project uses the following dependencies for handling protocol buffers:
3.29.0-rc22.67.0Ensure these packages are installed in your project.