Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterPayloadType ¶
func RegisterPayloadType(payloadType interface{})
RegisterPayloadType regiters payload type to payload encoder/decoder
Types ¶
type Bus ¶
type Bus interface { Publish(topic string, payload EventPayload) error AddHandler(handler EventHandler) }
Bus represents event bus
type Consumer ¶
type Consumer interface {
AddHandler(handler MessageHandler)
}
Consumer represents message consumer
type Event ¶
type Event struct { Topic string `json:"topic"` ID string `json:"id"` EmittedTime time.Time `json:"emitted_time"` Payload interface{} `json:"payload"` }
Event represents an event
func (*Event) MarshalJSON ¶
func (*Event) Scan ¶
func (event *Event) Scan(payload EventPayload) error
func (*Event) UnmarshalJSON ¶
type EventHandler ¶
EventHandler represents event handler
type MessageHandler ¶
MessageHandler represents message handler
Click to show internal directories.
Click to hide internal directories.