chermehdi / heartbeat

A simple registry server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Heartbeat

The distributed simple registry server.

API

Heartbeat exposes 2 types of APIs:

  1. REST API to talk to the UI.
  2. an RPC API to talk to the other nodes in the cluster.

REST API description

  • GET /services

This request returns the list of all available services along with their available instances

[
  {
    "name": "service-a",
    "uptime": 12312321,
    "instances": [
      "host1:port1",
      "host2:port2",
    ]
  },
  ...
]
  • GET /config

This request returns the list of all the available key-values stored in the heartbeat server

[
  {
    "key": "build-id",
    "value": "12AEDE234",
  },
  ...
]
  • PUT /config
{
  "key": "key",
  "value": "value"
}

This creates the config with the key and value in the heartbeat server, the server returns an OK status only if the key-value pair has been successfully persisted by the majority of nodes of the heartbeat server.

About

A simple registry server

License:MIT License


Languages

Language:Go 76.6%Language:JavaScript 10.5%Language:HTML 4.7%Language:CSS 3.3%Language:TypeScript 2.6%Language:Shell 2.3%