{"id":31833507,"url":"https://github.com/oastuff/leaderelection","last_synced_at":"2025-10-11T23:56:00.610Z","repository":{"id":144436645,"uuid":"52179372","full_name":"oaStuff/leaderElection","owner":"oaStuff","description":"Leadership election in Golang","archived":false,"fork":false,"pushed_at":"2016-02-20T23:15:56.000Z","size":6,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2023-03-21T21:51:51.870Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oaStuff.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-02-20T22:45:33.000Z","updated_at":"2023-05-05T17:38:29.803Z","dependencies_parsed_at":"2023-05-05T18:14:42.753Z","dependency_job_id":null,"html_url":"https://github.com/oaStuff/leaderElection","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"purl":"pkg:github/oaStuff/leaderElection","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oaStuff%2FleaderElection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oaStuff%2FleaderElection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oaStuff%2FleaderElection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oaStuff%2FleaderElection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oaStuff","download_url":"https://codeload.github.com/oaStuff/leaderElection/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oaStuff%2FleaderElection/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279009367,"owners_count":26084582,"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","status":"online","status_checked_at":"2025-10-11T02:00:06.511Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2025-10-11T23:55:38.254Z","updated_at":"2025-10-11T23:56:00.602Z","avatar_url":"https://github.com/oaStuff.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# This is a library implementing dynamic leadership election using bully algorithm in GO.\n### disclaimer\nI am not an expert implementing bully algorithm. This was just a 'play project' learning Golang.\n\n#### Installation\n\n```sh\ngo get github.com/oaStuff/leaderElection\n```\n### Usage\nThe usage is very simple. All node (application running on a seperate machine or a separate process) that wish to participate in coordinated operation and allowing only one process become leader must do \n* register a callback with the library\n* specify the multicast address to use\n* specify the network interface to use\n\n### Example\n```go\nfunc myCallback(state int){\n\tif state == election.LEADER {\n\t\tfmt.Println(\"Hey !, I am the leader and can do or setup things to become a leader\")\n\t} else if state == election.FOLLOWER {\n\t\tfmt.Println(\"I am a follower\")\n\t}\n}\n\nfunc main() {\n    bChan := make(chan bool)\n    err := election.RegisterCallback(myCallback,\"239.0.1.1:9999\",\"eth1\")\n\tif err != nil{\n\t\tpanic(err)\n\t}\n\t\n\t\u003c-bChan\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foastuff%2Fleaderelection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foastuff%2Fleaderelection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foastuff%2Fleaderelection/lists"}