Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OnMeowCreated ¶
func OnMeowCreated(f func(MeowCreatedMessage)) error
OnMeowCreated - Trigger on MeowCreated event
func PublishMeowCreated ¶
PublishMeowCreated - Push MeowCreated event to the EventStore
func SubscribeMeowCreated ¶
func SubscribeMeowCreated() (<-chan MeowCreatedMessage, error)
SubscribeMeowCreated - Receives MeowCreated events
Types ¶
type EventStore ¶
type EventStore interface { Close() PublishMeowCreated(meow schema.Meow) error SubscribeMeowCreated() (<-chan MeowCreatedMessage, error) OnMeowCreated(f func(MeowCreatedMessage)) error }
EventStore .
type MeowCreatedMessage ¶
MeowCreatedMessage Meow messag
type NatEventStore ¶
type NatEventStore struct {
// contains filtered or unexported fields
}
NatEventStore NATS implementation for EventStore interface
func NewNats ¶
func NewNats(url string) (*NatEventStore, error)
NewNats creates stream connection with NATS
func (*NatEventStore) OnMeowCreated ¶
func (e *NatEventStore) OnMeowCreated(fn func(MeowCreatedMessage)) (err error)
OnMeowCreated attach a function to handle MeowCreated event
func (*NatEventStore) PublishMeowCreated ¶
func (e *NatEventStore) PublishMeowCreated(meow schema.Meow) error
PublishMeowCreated inserts MeowCreated event
func (*NatEventStore) SubscribeMeowCreated ¶
func (e *NatEventStore) SubscribeMeowCreated() (<-chan MeowCreatedMessage, error)
SubscribeMeowCreated Decode events from NATS and routes to a channel with MeowCreated event
Click to show internal directories.
Click to hide internal directories.