mirror of
https://github.com/fluffle/goirc
synced 2025-05-13 02:53:19 +00:00
Add an overridable Dispatcher to Conn, and use that to dispatch events.
This commit is contained in:
parent
900afb5c48
commit
8e6de2f3c7
3 changed files with 15 additions and 12 deletions
|
@ -36,6 +36,10 @@ func NewHandler(h func(...interface{})) Handler {
|
|||
return &basicHandler{h, NewHandlerID()}
|
||||
}
|
||||
|
||||
type EventDispatcher interface {
|
||||
Dispatch(name string, ev...interface{})
|
||||
}
|
||||
|
||||
type EventRegistry interface {
|
||||
AddHandler(name string, h Handler)
|
||||
DelHandler(h Handler)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue