Skip to content

beldmian/light

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

light

godoc codecov sourcegrpah

Simple to use, "zero-allocation" event system

Installation

To install package use command:

go get github.com/beldmian/light

Example

light.Handle("hello", func(e light.Event) error {
    fmt.Printf("Hello, %s\n", e.Payload["name"])
    return nil
})

light.Emit(light.Event{
    Name:    "hello",
    Payload: map[string]interface{}{"name": "light"},
})

Contribute

All contributions are welcome. Please open issue if you want to provide some new features.