proxy.golang.org : github.com/gocrumb/event
Event is a tool to generate observer pattern code for your events. Given the name(s) of event types, this tool will generate the following symbols in a self-contained Go source file: For example, given this snippet, running this command in the same directory will create the file event.go, in package ev, containing the definitions of all the relevant symbols. You can then listen for events by doing this: And, emit events by doing this: Typically this process would be run using go generate, like this: With no arguments, it processes the package in the current directory. Otherwise, the arguments must name a single directory holding a Go package or a set of Go source files that represent a single Go package. The -type flag accepts a comma-separated list of types so a single run can generate symbols for multiple types. The default output file is event.go. It can be overridden with the -output flag. A more complete list of symbols generated for each type is as follows:
Registry
-
Source
- Documentation
- JSON
- codemeta.json
purl: pkg:golang/github.com/gocrumb/event
Keywords:
go
, golang
, observer-pattern
License: BSD-3-Clause
Latest release: over 4 years ago
First release: over 4 years ago
Namespace: github.com/gocrumb
Stars: 4 on GitHub
Forks: 0 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 3 months ago