https://github.com/issue9/events
简单的事件订阅发布系统
https://github.com/issue9/events
event events go golang subscribers
Last synced: 4 months ago
JSON representation
简单的事件订阅发布系统
- Host: GitHub
- URL: https://github.com/issue9/events
- Owner: issue9
- License: mit
- Created: 2019-01-04T16:30:34.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-12-19T16:34:58.000Z (over 1 year ago)
- Last Synced: 2025-08-13T21:04:18.310Z (10 months ago)
- Topics: event, events, go, golang, subscribers
- Language: Go
- Homepage: https://pkg.go.dev/mod/github.com/issue9/events
- Size: 49.8 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
events
[](https://github.com/issue9/events/actions?query=workflow%3AGo)
[](https://opensource.org/licenses/MIT)
[](https://codecov.io/gh/issue9/events)
[](https://pkg.go.dev/github.com/issue9/events)
======
简单的事件订阅发布系统
```go
e := events.New[string]()
e.Subscribe(sub1)
e.Subscribe(sub2)
e.Publish(true, "触发事件1") // sub1 和 sub2 均会收事事件
```
安装
----
```shell
go get github.com/issue9/events
```
版权
----
本项目采用 [MIT](https://opensource.org/licenses/MIT) 开源授权许可证,完整的授权说明可在 [LICENSE](LICENSE) 文件中找到。