🔍 A lightweight service discovery mechanism written in Go to manage and monitor distributed systems efficiently.
- 🌐 Cluster Management: Easily manage and configure clusters.
- 📡 Service Discovery: Real-time service discovery and health checks.
- 🔄 Fault Tolerance: Automatic detection and handling of node failures.
- 📊 Scalability: Designed to scale horizontally.
-
Clone the repository:
git clone https://github.com/ankitpyc/go-service-discovery.git cd go-service-discovery
-
Build the project:
go build
To start the TCP server, use the following command:
./go-service-discovery --host <HOST> --port <PORT>
./go-service-discovery --host 127.0.0.1 --port 2212
// Sending a Request
You can use netcat to send a request to the server:
echo -n -e '\x00{"ClusterID": "1", "NodeID": "node-123"}' | nc 127.0.0.1 2212
📚 API
- AddClusterMemberList(member ClusterMember): Add a new member to the cluster.
- ListenForBroadcasts(): Listen for broadcast messages within the cluster.
- Server Methods:
- *StartServer() (Server, error): Start the TCP server.
- ListenAndAccept() error: Accept incoming TCP connections.
- StopServer() error: Stop the TCP server.
Contributions, issues, and feature requests are welcome! Feel free to check the issues page.
- Fork the repository
- Create your feature branch:
git checkout -b feature/feature-name
- Commit your changes:
git commit -m 'Add some feature'
- Push to the branch:
git push origin feature/feature-name
- Open a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
Author: Ankit
Contributors: See the list of contributors who participated in this project.