{"id":15567618,"url":"https://github.com/purehyperbole/gossip","last_synced_at":"2025-08-22T15:04:39.395Z","repository":{"id":59047588,"uuid":"534549402","full_name":"purehyperbole/gossip","owner":"purehyperbole","description":"A simple gossip protocol implementation","archived":false,"fork":false,"pushed_at":"2022-09-22T16:00:42.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-23T05:43:42.113Z","etag":null,"topics":["golang","gossip-protocol"],"latest_commit_sha":null,"homepage":"","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/purehyperbole.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-09-09T07:48:34.000Z","updated_at":"2022-09-22T10:34:54.000Z","dependencies_parsed_at":"2023-01-18T19:15:13.201Z","dependency_job_id":null,"html_url":"https://github.com/purehyperbole/gossip","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/purehyperbole/gossip","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/purehyperbole%2Fgossip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/purehyperbole%2Fgossip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/purehyperbole%2Fgossip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/purehyperbole%2Fgossip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/purehyperbole","download_url":"https://codeload.github.com/purehyperbole/gossip/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/purehyperbole%2Fgossip/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271657484,"owners_count":24797934,"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-08-22T02:00:08.480Z","response_time":65,"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":["golang","gossip-protocol"],"created_at":"2024-10-02T17:12:02.457Z","updated_at":"2025-08-22T15:04:39.228Z","avatar_url":"https://github.com/purehyperbole.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gossip [![Go Reference](https://pkg.go.dev/badge/github.com/purehyperbole/gossip.svg)](https://pkg.go.dev/github.com/purehyperbole/gossip) [![Go Report Card](https://goreportcard.com/badge/github.com/purehyperbole/gossip)](https://goreportcard.com/report/github.com/purehyperbole/gossip) ![Build Status](https://github.com/purehyperbole/gossip/actions/workflows/ci.yml/badge.svg)\n\nA simple gossip protocol implementation in \u003c 200 lines of Go.\n\nThe fanout factor 'k' is defaulted to 13, optimised for large networks \u003e 10000 nodes. You should try and reduce this to a more reasonable value if your network is smaller.\n\n## Usage\n\n```go\nfunc main() {\n    // some other gossip nodes on the network\n    nodes := make([]*net.UDPAddr, 100)\n\n    for i := range nodes {\n        // parse the node address and add it to the list\n        nodes[i], _ = net.ResolveUDPAddr(\"udp\", fmt.Sprintf(\"10.64.0.%d:10000\", 101+i))\n    }\n\n    cfg := \u0026gossip.Config{\n        Fanout: gossip.DefaultFanout,         // number of nodes to forward gossip messages to (default: 13)\n        Nodes: gossip.DefaultNodeList(nodes), // specifies a node list that random nodes can be selected from\n        ListenAddress: \"10.64.0.100:10000\",   // udp address to bind to\n        OnGossip: func(message []byte) {\n            // callback to handle gossip messages\n            // ensure that the message value is not used outside of this callback!\n            m := make([]byte, len(message))\n            copy(m, message)\n\n            // do something with m...\n        },\n    }\n\n    network, err := gossip.New(cfg)\n    if err != nil {\n        log.Fatal(err)\n    }\n\n    log.Println(\"gossip node started!\")\n\n    // send a message to the network\n    err = network.Gossip([]byte(\"hello!\"))\n    if err != nil {\n        log.Fatal(err)\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpurehyperbole%2Fgossip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpurehyperbole%2Fgossip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpurehyperbole%2Fgossip/lists"}