This project implements a Complete Backend Infrastruture Framework in Golang with the ability to deploy Single to Multi system Dsitributed services via Runners and Built in Channel Network Registry with GrPc services for fast communication between Different Runner operated via a Central Revenge Server with features like (GraphQL,Rest,SSE,webSockets,Https and lot more architectures to choose from),. It features a custom message struct for efficiently managing messages and a user registry for storing user context. Additionally, the server utilizes scheduled tasks to maintain and flush user records daily.
- SSE Support: Real-time communication with clients using Server-Sent Events.
- Custom Message Structs: Optimized data handling with structured message formats.
- User Registry: Dedicated storage for user contexts, improving interaction management.
- Scheduled Tasks: Automated daily tasks to maintain and update user records, ensuring data integrity and performance.
Before you start, ensure you have the following installed:
- Go (version 1.15 or later)
- Echo Framework
- Cron package for Go
To get the server running locally, follow these steps:
-
Clone the repository:
git clone https://github.com/theDewill/SSEbridge.git cd golang-sse-server
-
Install dependencies:
go mod tidy
-
Build the project:
go build -o sse-server
-
Run the server:
./sse-server
After starting the server, it will listen on port 8080. You can connect to the SSE endpoint at:
http://localhost:8080/startSSE
Clients connected to this endpoint will receive real-time events sent from the server.
The server uses a cron job to call the Flush()
method on the user_registry
every day at 12:00 PM. This task ensures that user records are consistently up-to-date and reduces memory usage over time.
Contributions are welcome! Feel free to fork the repository and submit pull requests.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
Nomin Sendinu - [email protected]
Project Link: https://github.com/theDewill/SSEbridge