{"id":37140640,"url":"https://github.com/xormplus/go-events","last_synced_at":"2026-01-14T16:29:03.739Z","repository":{"id":57594835,"uuid":"95103883","full_name":"xormplus/go-events","owner":"xormplus","description":":mega: Pure nodejs EventEmmiter for the  Go Programming Language.","archived":false,"fork":true,"pushed_at":"2017-06-04T00:44:43.000Z","size":116,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-20T12:43:47.247Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"kataras/go-events","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xormplus.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":"2017-06-22T10:27:47.000Z","updated_at":"2017-06-22T10:27:49.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/xormplus/go-events","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/xormplus/go-events","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xormplus%2Fgo-events","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xormplus%2Fgo-events/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xormplus%2Fgo-events/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xormplus%2Fgo-events/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xormplus","download_url":"https://codeload.github.com/xormplus/go-events/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xormplus%2Fgo-events/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28425941,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T15:24:48.085Z","status":"ssl_error","status_checked_at":"2026-01-14T15:23:41.940Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":"2026-01-14T16:29:03.173Z","updated_at":"2026-01-14T16:29:03.731Z","avatar_url":"https://github.com/xormplus.png","language":"Go","funding_links":["https://www.paypal.com/cgi-bin/webscr?cmd=_donations\u0026business=kataras2006%40hotmail%2ecom\u0026lc=GR\u0026item_name=Iris%20web%20framework\u0026item_number=iriswebframeworkdonationid2016\u0026currency_code=EUR\u0026bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"/logo.jpg\" height=\"400\"\u003e\n  \u003cbr/\u003e\n\u003c/p\u003e\n\n \u003ca href=\"https://travis-ci.org/kataras/go-events\"\u003e\u003cimg src=\"https://img.shields.io/travis/kataras/go-events.svg?style=flat-square\" alt=\"Build Status\"\u003e\u003c/a\u003e\n \u003ca href=\"https://github.com/avelino/awesome-go\"\u003e\u003cimg src=\"https://img.shields.io/badge/awesome-%E2%9C%93-ff69b4.svg?style=flat-square\" alt=\"Awesome GoLang\"\u003e\u003c/a\u003e\n \u003ca href=\"http://goreportcard.com/report/kataras/go-events\"\u003e\u003cimg src=\"https://img.shields.io/badge/-A%2B-F44336.svg?style=flat-square\" alt=\"Report A+\"\u003e\u003c/a\u003e\n \u003ca href=\"https://github.com/kataras/go-events/blob/master/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/badge/%20license-MIT%20-E91E63.svg?style=flat-square\" alt=\"License\"\u003e\u003c/a\u003e\n \u003ca href=\"https://github.com/kataras/go-events/releases\"\u003e\u003cimg src=\"https://img.shields.io/badge/%20release%20-%20v0.0.2-blue.svg?style=flat-square\" alt=\"Releases\"\u003e\u003c/a\u003e\n \u003ca href=\"https://godoc.org/github.com/kataras/go-events\"\u003e\u003cimg src=\"https://img.shields.io/badge/%20docs-reference-5272B4.svg?style=flat-square\" alt=\"Read me docs\"\u003e\u003c/a\u003e\n \u003ca href=\"https://kataras.rocket.chat/channel/go-events\"\u003e\u003cimg src=\"https://img.shields.io/badge/%20community-chat-00BCD4.svg?style=flat-square\" alt=\"Chat\"\u003e\u003c/a\u003e\n\u003cbr/\u003e\n\nSimple EventEmmiter for Go Programming Language. Inspired by \u003ca href=\"https://nodejs.org/api/events.html\"\u003eNodejs EventEmitter\u003c/a\u003e.\n\nOverview\n------------\n`New() EventEmmiter  // New returns a new, empty, EventEmmiter`\n\n\n```go\n// AddListener is an alias for .On(eventName, listener).\nAddListener(EventName, ...Listener)\n// Emit fires a particular event,\n// Synchronously calls each of the listeners registered for the event named\n// eventName, in the order they were registered,\n// passing the supplied arguments to each.\nEmit(EventName, ...interface{})\n// EventNames returns an array listing the events for which the emitter has registered listeners.\n// The values in the array will be strings.\nEventNames() []EventName\n// GetMaxListeners returns the max listeners for this emmiter\n// see SetMaxListeners\nGetMaxListeners() int\n// ListenerCount returns the length of all registered listeners to a particular event\nListenerCount(EventName) int\n// Listeners returns a copy of the array of listeners for the event named eventName.\nListeners(EventName) []Listener\n// On registers a particular listener for an event, func receiver parameter(s) is/are optional\nOn(EventName, ...Listener)\n// Once adds a one time listener function for the event named eventName.\n// The next time eventName is triggered, this listener is removed and then invoked.\nOnce(EventName, ...Listener)\n// RemoveAllListeners removes all listeners, or those of the specified eventName.\n// Note that it will remove the event itself.\n// Returns an indicator if event and listeners were found before the remove.\nRemoveAllListeners(EventName) bool\n// Clear removes all events and all listeners, restores Events to an empty value\nClear()\n// SetMaxListeners obviously this function allows the MaxListeners\n// to be decrease or increase. Set to zero for unlimited\nSetMaxListeners(int)\n// Len returns the length of all registered events\nLen() int\n```\n\n\n```go\nimport \"github.com/kataras/go-events\"\n\n// initialize a new EventEmmiter to use\ne := events.New()\n\n// register an event with name \"my_event\" and one listener\ne.On(\"my_event\", func(payload ...interface{}) {\n  message := payload[0].(string)\n  print(message) // prints \"this is my payload\"\n})\n\n// fire the 'my_event' event\ne.Emit(\"my_event\", \"this is my payload\")\n\n```\n\nDefault/global EventEmmiter\n```go\n\n// register an event with name \"my_event\" and one listener to the global(package level) default EventEmmiter\nevents.On(\"my_event\", func(payload ...interface{}) {\n  message := payload[0].(string)\n  print(message) // prints \"this is my payload\"\n})\n\n// fire the 'my_event' event\nevents.Emit(\"my_event\", \"this is my payload\")\n\n```\n\nRemove an event\n\n```go\n\nevents.On(\"my_event\", func(payload ...interface{}) {\n  // first listener...\n},func (payload ...interface{}){\n  // second listener...\n})\n\nprintln(events.Len()) // prints 1\nprintln(events.ListenerCount(\"my_event\")) // prints 2\n\n// Remove our event, when/if we don't need this or we want to clear all of its listeners\nevents.RemoveAllListeners(\"my_event\")\n\nprintln(events.Len()) // prints 0\nprintln(events.ListenerCount(\"my_event\")) // prints 0\n\n\n```\nInstallation\n------------\n\nThe only requirement is the [Go Programming Language](https://golang.org/dl).\n\n```bash\n$ go get -u github.com/kataras/go-events\n```\n\n\nFAQ\n------------\n\nExplore [these questions](https://github.com/kataras/go-events/issues?go-events=label%3Aquestion) or navigate to the [community chat][Chat].\n\nVersioning\n------------\n\nCurrent: v0.0.2\n\nRead more about Semantic Versioning 2.0.0\n\n - http://semver.org/\n - https://en.wikipedia.org/wiki/Software_versioning\n - https://wiki.debian.org/UpstreamGuide#Releases_and_Versions\n\nPeople\n------------\n\nThe author of go-events is [@kataras](https://github.com/kataras).\n\nIf you're **willing to donate**, feel free to send **any** amount through paypal\n\n[![](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations\u0026business=kataras2006%40hotmail%2ecom\u0026lc=GR\u0026item_name=Iris%20web%20framework\u0026item_number=iriswebframeworkdonationid2016\u0026currency_code=EUR\u0026bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted)\n\n\nContributing\n------------\n\nIf you are interested in contributing to the go-events project, please make a PR.\n\nLicense\n------------\n\nThis project is licensed under the MIT License.\n\nLicense can be found [here](LICENSE).\n\n[Chat Widget]: https://img.shields.io/badge/community-chat-00BCD4.svg?style=flat-square\n[Chat]: https://kataras.rocket.chat/channel/go-events\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxormplus%2Fgo-events","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxormplus%2Fgo-events","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxormplus%2Fgo-events/lists"}