/go-service-discovery

a go service discovery

Primary LanguageGo

🌟 Go Service Discovery 🌟

Go License Build Status

🔍 A lightweight service discovery mechanism written in Go to manage and monitor distributed systems efficiently.

Service Discovery

🚀 Features

  • 🌐 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.

📖 Table of Contents

🛠️ Installation

  1. Clone the repository:

    git clone https://github.com/ankitpyc/go-service-discovery.git
    cd go-service-discovery
  2. Build the project:

    go build

🚦 Usage

Starting the Server

To start the TCP server, use the following command:

./go-service-discovery --host <HOST> --port <PORT>

Example:

./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

Features

  • 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.

🤝 Contributing

Contributions, issues, and feature requests are welcome! Feel free to check the issues page.

  1. Fork the repository
  2. Create your feature branch: git checkout -b feature/feature-name
  3. Commit your changes: git commit -m 'Add some feature'
  4. Push to the branch: git push origin feature/feature-name
  5. Open a pull request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

✨ Credits

Author: Ankit

Contributors: See the list of contributors who participated in this project.