{"id":22980498,"url":"https://github.com/kcartlidge/simple-service-discovery","last_synced_at":"2025-04-02T09:40:30.392Z","repository":{"id":145848662,"uuid":"105585725","full_name":"kcartlidge/simple-service-discovery","owner":"kcartlidge","description":"An easy to use service discovery tool and health check, based upon endpoints defined in a config file,","archived":false,"fork":false,"pushed_at":"2021-12-19T22:55:05.000Z","size":10919,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-08T00:41:26.412Z","etag":null,"topics":["golang","health-check","ping","server","service-discovery","uptime"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kcartlidge.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-10-02T21:13:33.000Z","updated_at":"2023-05-12T16:48:55.000Z","dependencies_parsed_at":"2023-05-21T06:00:12.485Z","dependency_job_id":null,"html_url":"https://github.com/kcartlidge/simple-service-discovery","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kcartlidge%2Fsimple-service-discovery","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kcartlidge%2Fsimple-service-discovery/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kcartlidge%2Fsimple-service-discovery/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kcartlidge%2Fsimple-service-discovery/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kcartlidge","download_url":"https://codeload.github.com/kcartlidge/simple-service-discovery/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246792391,"owners_count":20834920,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang","health-check","ping","server","service-discovery","uptime"],"created_at":"2024-12-15T01:43:44.274Z","updated_at":"2025-04-02T09:40:30.373Z","avatar_url":"https://github.com/kcartlidge.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simple-Service-Discovery\n\nAn easy to use **service discovery** and **health check** tool, based upon endpoints defined in an ```ssd.ini``` file:\n\n``` ini\n[SETTINGS]\n# Number of seconds between health checks.\npoll-seconds = 30\nport = 1337\n\n[ENDPOINTS]\n# Billing site endpoints, including failover servers.\nbilling-test = http://billing-test.example.com:8080\nbilling-prod = https://billing1.example.com\nbilling-prod = https://billing2.example.com\nbilling-prod = https://billing3.example.com\n\n# Authentication API endpoints, including failover servers.\nauth-uat = http://my-auth.example.com:8080\nauth-prod =  https://my-auth-1.example.com\nauth-prod =  https://my-auth-2.example.com\n```\n\n## Features\n\n* No service registration, just update the ```ssd.ini``` file to make changes.\n* Endpoints have names, so you can go from a generic name like 'billing' to an exact endpoint, thus giving service discovery.\n* Multiple endpoints can have the same name, so your app can choose the one with the best health.\n* Polling system checks the status of the endpoints on a regular frequency of your choice.\n* Simple JSON response gives the location and status of all endpoints by name.\n\n## Status\n\n* Working\n* Services API (```/services```)\n* Health check\n* Endpoint changes automatically loaded without restart\n\nNote that the *port* and *polling frequency* cannot be changed without restarting, unlike *endpoints* which are dynamically reloaded when the config changes.\n\n## How to use it\n\nPopulate the ```ssd.ini``` file and drop it on a server somewhere alongside the built executable of ```simple-service-discovery```. This is a single file and can be downloaded ready-built for *Linux*, *Windows* and *MacOS* from the ```builds``` subfolder.\n\nStart it going.\n\n*Optional: Point a DNS entry at the running instance so no knowledge of machines, IP addresses etc are required by clients.*\n\n### Important note\n\nIf your endpoints are not fast-responding, please be aware that the polling frequency is based purely on time elapsed and does not allow for the time taken for the checks to be performed. In other words, ensure your frequency is longer than your anticipated checks duration, otherwise you risk overlapping checks.\n\nIt should be remembered that this is a service discovery tool, and the health check is an added bonus. Therefore if your use case is primarily as service discovery you probably don't need a high granularity frequency anyway (something like 300 seconds is probably fine).\n\n### GET /services\n\nThis returns the endpoint(s) as an array of JSON object:\n\n``` json\n[\n  {\n    \"name\": \"auth-prod\",\n    \"endpoint\": \"https://my-auth-1.example.com\",\n    \"status\": 200\n  },\n  {\n    \"name\": \"auth-prod\",\n    \"endpoint\": \"https://my-auth-2.example.com\",\n    \"status\": 200\n  }\n]\n```\n\nAll endpoints with the given key name are returned, along with their last known HTTP status code.\n\n---\n\n## Building and running\n\n### One-off build and run\n\n``` sh\ncd \u003cproject-root\u003e\ngo build -o builds/linux/ssd \u0026\u0026 ./builds/linux/ssd # Linux\ngo build -o builds/macos/ssd \u0026\u0026 ./builds/macos/ssd # Mac OS\ngo build -o builds\\windows\\ssd.exe \u0026\u0026 .\\builds\\windows\\ssd.exe # Windows\n```\n\n### Build all platform executables\n\nThese are tiny, and so are committed to the repository in the ```builds``` folder.\n\n``` sh\ncd \u003cproject-root\u003e\n./make/make-linux.sh \u0026\u0026 ./builds/linux/ssd # Linux\n./make/make-macos.sh \u0026\u0026 ./builds/macos/ssd # Mac OS\n./make/make-windows.bat \u0026\u0026 .\\builds\\windows\\ssd.exe # Windows\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkcartlidge%2Fsimple-service-discovery","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkcartlidge%2Fsimple-service-discovery","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkcartlidge%2Fsimple-service-discovery/lists"}