An open API service indexing awesome lists of open source software.

https://github.com/chrootlogin/event

A small event handling system for Go
https://github.com/chrootlogin/event

events go golang

Last synced: 25 days ago
JSON representation

A small event handling system for Go

Awesome Lists containing this project

README

          

# Event Handler for GoLang

This can be used to create an event system in your go application

## Example

### Register event handler

```
event.Events().On("init-router", func(input ...interface{}) {
router, ok := input[0].(*gin.Engine)
if !ok {
log.Fatal("Can't convert input to gin.Engine.")
}

plugins.Registry().RegisterRoutes(router)
})
```

### Emit event and run event handlers

```
event.Events().Emit("init-router", router)
```

## License

This stuff is licensed under LGPL 3.0.