mirror of
https://github.com/jhillyerd/inbucket.git
synced 2025-12-17 17:47:03 +00:00
extension: Add MessageStored event (#316)
* Replace existing direct StoreManager->msghub communication with this event * For #280 #309 #312 #310 Signed-off-by: James Hillyerd <james@hillyerd.com> Signed-off-by: James Hillyerd <james@hillyerd.com>
This commit is contained in:
23
pkg/extension/host.go
Normal file
23
pkg/extension/host.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package extension
|
||||
|
||||
import (
|
||||
"github.com/inbucket/inbucket/pkg/extension/event"
|
||||
)
|
||||
|
||||
// Host defines extension points for Inbucket.
|
||||
type Host struct {
|
||||
Events *Events
|
||||
}
|
||||
|
||||
// Events defines all the event types supported by the extension host.
|
||||
type Events struct {
|
||||
MessageStored EventBroker[event.MessageMetadata, Void]
|
||||
}
|
||||
|
||||
// Void indicates the event emitter will ignore any value returned by listeners.
|
||||
type Void struct{}
|
||||
|
||||
// NewHost creates a new extension host.
|
||||
func NewHost() *Host {
|
||||
return &Host{Events: &Events{}}
|
||||
}
|
||||
Reference in New Issue
Block a user