{"id":16464490,"url":"https://github.com/deatil/go-events","last_synced_at":"2025-05-07T08:23:33.338Z","repository":{"id":250262115,"uuid":"814577270","full_name":"deatil/go-events","owner":"deatil","description":"go-events is a go event and event'subscribe pkg, like wordpress hook functions","archived":false,"fork":false,"pushed_at":"2024-12-04T03:07:16.000Z","size":73,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-31T08:06:59.609Z","etag":null,"topics":["event","events","go-event","go-events","go-hook","hook","listen","wordpress"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/deatil/go-events","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deatil.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-13T09:26:23.000Z","updated_at":"2025-03-20T19:38:50.000Z","dependencies_parsed_at":"2024-08-28T16:31:44.285Z","dependency_job_id":"71422eba-5104-40f8-b524-0d9766d4f7e5","html_url":"https://github.com/deatil/go-events","commit_stats":null,"previous_names":["deatil/go-events"],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deatil%2Fgo-events","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deatil%2Fgo-events/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deatil%2Fgo-events/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deatil%2Fgo-events/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deatil","download_url":"https://codeload.github.com/deatil/go-events/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252840157,"owners_count":21812252,"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":["event","events","go-event","go-events","go-hook","hook","listen","wordpress"],"created_at":"2024-10-11T11:28:05.208Z","updated_at":"2025-05-07T08:23:33.308Z","avatar_url":"https://github.com/deatil.png","language":"Go","funding_links":[],"categories":["Utilities","公用事业公司"],"sub_categories":["Utility/Miscellaneous","实用程序/Miscellaneous"],"readme":"## go-events\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://pkg.go.dev/github.com/deatil/go-events\" target=\"_blank\"\u003e\u003cimg src=\"https://pkg.go.dev/badge/deatil/go-events.svg\" alt=\"Go Reference\"\u003e\u003c/a\u003e\n\u003ca href=\"https://app.codecov.io/gh/deatil/go-events\" target=\"_blank\"\u003e\u003cimg src=\"https://codecov.io/gh/deatil/go-events/graph/badge.svg?token=SS2Z1IY0XL\"/\u003e\u003c/a\u003e\n\u003ca href=\"https://goreportcard.com/report/github.com/deatil/go-events\" target=\"_blank\"\u003e\u003cimg src=\"https://goreportcard.com/badge/github.com/deatil/go-events\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/avelino/awesome-go\"\u003e\u003cimg src=\"https://awesome.re/mentioned-badge.svg\" alt=\"Mentioned in Awesome Go\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\n### Desc\n\n*  go-events is a go event and event'subscribe pkg, like wordpress hook functions.\n\n[中文](README_CN.md) | English\n\n\n### Download\n\n~~~go\ngo get -u github.com/deatil/go-events\n~~~\n\n\n### Get Starting\n\n~~~go\npackage main\n\nimport (\n    \"fmt\"\n    \"github.com/deatil/go-events/events\"\n)\n\nfunc main() {\n    // use action\n    events.AddAction(\"test1\", func() {\n        fmt.Println(\"test1\")\n    }, events.DefaultSort)\n\n    events.DoAction(\"test1\")\n\n    // use Filter\n    events.AddFilter(\"test1\", func(val string) string {\n        return \"run test1 =\u003e \" + val\n    }, events.DefaultSort)\n\n    data1 := \"init1\"\n    test := events.ApplyFilters(\"test1\", data1)\n\n    fmt.Println(test)\n    // output: run test1 =\u003e init1\n}\n\n~~~\n\n\n### LICENSE\n\n*  The library LICENSE is `Apache2`, using the library need keep the LICENSE.\n\n\n### Copyright\n\n*  Copyright deatil(https://github.com/deatil).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeatil%2Fgo-events","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeatil%2Fgo-events","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeatil%2Fgo-events/lists"}