Documentation
¶
Index ¶
- Constants
- func Emit(e Event) error
- func EmitError(kind string, err error, payload interface{}) error
- func EmitPayload(kind string, payload interface{}) error
- func List() ([]string, error)
- func LoadPlugins() error
- func SetManager(m Manager)
- type DeleteFn
- type Event
- type Listener
- type Manager
- type Payload
Constants ¶
View Source
const ( // ErrGeneral is emitted for general errors ErrGeneral = "general:err" // ErrPanic is emitted when a panic is recovered ErrPanic = "panic:err" )
View Source
const Version = "v1.4.0"
Variables ¶
This section is empty.
Functions ¶
func EmitPayload ¶
func LoadPlugins ¶
func LoadPlugins() error
LoadPlugins will add listeners for any plugins that support "events"
func SetManager ¶
func SetManager(m Manager)
SetManager allows you to replace the default event manager with a custom one
Types ¶
type Event ¶
type Event struct { // Kind is the "type" of event "app:start" Kind string `json:"kind"` // Message is optional Message string `json:"message"` // Payload is optional Payload Payload `json:"payload"` // Error is optional Error error `json:"-"` }
Event represents different events in the lifecycle of a Buffalo app
func (Event) MarshalJSON ¶
MarshalJSON implements the json marshaler for an event