Documentation ¶
Index ¶
- Constants
- type BehaviorStoreFtor
- type BusFtor
- type CmdHandlerFtor
- type CommandHandler
- type Component
- type EventReaction
- func (er *EventReaction) Activate(ctx context.Context) error
- func (er *EventReaction) Deactivate(ctx context.Context) error
- func (er *EventReaction) GetEventType() behavior.EventType
- func (er *EventReaction) React(ctx context.Context, evt behavior.IEvt) error
- func (er *EventReaction) Subscribe(ctx context.Context, topic string, when OnEvtFunc, transactional bool) error
- func (er *EventReaction) SubscribeAll(ctx context.Context, when OnEvtFunc, transactional bool) error
- func (er *EventReaction) SubscribeAllAsync(events chan behavior.IEvt, transactional bool) map[string]error
- func (er *EventReaction) SubscribeAsync(events chan behavior.IEvt, transactional bool) error
- func (er *EventReaction) Unsubscribe(topic string, fn OnEvtFunc) error
- func (er *EventReaction) UnsubscribeAll(when OnEvtFunc) map[string]error
- type EventStoreFtor
- type EvtReactionFtor
- type GenBusFtor
- type GenCommandHandler
- type GenEvtReactionFtor
- type GenEvtReactor
- func (er *GenEvtReactor[TEvt]) Activate(ctx context.Context) error
- func (er *GenEvtReactor[TEvt]) Deactivate(ctx context.Context) error
- func (er *GenEvtReactor[TEvt]) GetEventType() behavior.EventType
- func (er *GenEvtReactor[TEvt]) React(ctx context.Context, evt TEvt) error
- func (er *GenEvtReactor[TEvt]) SubscribeAsync(events chan TEvt, transactional bool) error
- type GenMediatorLoggerFtor
- type GenMsgReactionFtor
- type GenProjFtor
- type GenProjection
- type GenProjectionFtor
- type GenReactFunc
- type GenRequesterFtor
- type GenResponderFtor
- type IActivate
- type IBehaviorStore
- type IBus
- type IClose
- type ICmdHandler
- type IComponent
- type IConnection
- type IDeactivate
- type IEmitter
- type IEventStore
- type IEvtReaction
- type IGenBus
- type IGenCmdHandler
- type IGenEvtReaction
- type IGenListener
- type IGenMediatorLogger
- type IGenMediatorReaction
- type IGenMsgReaction
- type IGenProjection
- type IGenRequester
- type IGenResponder
- type IListener
- type IMediatorLogger
- type IMediatorReaction
- type IMsgReaction
- type IPolicy
- type IProjection
- type IProjector
- type IQueryProvider
- type IRequester
- type IResponder
- type IShutdown
- type ISnapshotStore
- type ISpokePlugin
- type IStore
- type MediatorLoggerFtor
- type MsgReaction
- func (h *MsgReaction) Activate(ctx context.Context) error
- func (h *MsgReaction) Deactivate(ctx context.Context) error
- func (h *MsgReaction) GetMsgType() schema.MsgType
- func (h *MsgReaction) Subscribe(ctx context.Context, topic string, when OnMsgFunc, transactional bool) error
- func (h *MsgReaction) SubscribeAll(ctx context.Context, when OnMsgFunc, transactional bool) error
- func (h *MsgReaction) SubscribeAllAsync(msgs chan schema.IMsg, transactional bool) map[string]error
- func (h *MsgReaction) SubscribeAsync(msgs chan schema.IMsg, transactional bool) error
- func (h *MsgReaction) Unsubscribe(topic string, fn OnMsgFunc) error
- func (h *MsgReaction) UnsubscribeAll(when OnMsgFunc) map[string]error
- func (h *MsgReaction) When(ctx context.Context, msg schema.IMsg) error
- type MsgReactionFtor
- type OnEvtFunc
- type OnMsgFunc
- type Policy
- type ProjFtor
- type ProjectorBuilder
- type ProjectorFtor
- type QryProvider
- type QryWorker
- type RequesterFtor
Constants ¶
const AllTopics = "*"
const (
CmdHandlerFmt = "%+v.CmdHandler"
)
const EventReactionFmt = "%+v.EvtReaction"
const MsgReactionFmt = "%+v.MsgReaction"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BehaviorStoreFtor ¶
type BehaviorStoreFtor func() IBehaviorStore
type CmdHandlerFtor ¶
type CmdHandlerFtor func() ICmdHandler
func CmdHandler ¶
func CmdHandler(newAs BehaviorStoreFtor, newAgg behavior.BehaviorBuilder) CmdHandlerFtor
type CommandHandler ¶
type Component ¶
func NewComponent ¶
func (*Component) GetConfig ¶
func (a *Component) GetConfig() config.IAppConfig
func (*Component) GetLogger ¶
func (a *Component) GetLogger() logger.IAppLogger
func (*Component) GetMediator ¶
type EventReaction ¶
type EventReaction struct { *Component // contains filtered or unexported fields }
EventReaction is a base structure for implementing specialized Reactions to Events
func NewEventReaction ¶
func NewEventReaction( eventType behavior.EventType, react OnEvtFunc, ) *EventReaction
func (*EventReaction) Activate ¶
func (er *EventReaction) Activate(ctx context.Context) error
Activate activates the Reaction and subscribes to the specific Event type on the Mediator
func (*EventReaction) Deactivate ¶
func (er *EventReaction) Deactivate(ctx context.Context) error
func (*EventReaction) GetEventType ¶
func (er *EventReaction) GetEventType() behavior.EventType
func (*EventReaction) Subscribe ¶
func (er *EventReaction) Subscribe(ctx context.Context, topic string, when OnEvtFunc, transactional bool) error
Subscribe connects the Reaction to a specific Event that appears on the Mediator
func (*EventReaction) SubscribeAll ¶
func (er *EventReaction) SubscribeAll(ctx context.Context, when OnEvtFunc, transactional bool) error
SubscribeAll subscribes to all events that appear on the Mediator
func (*EventReaction) SubscribeAllAsync ¶
func (*EventReaction) SubscribeAsync ¶
func (er *EventReaction) SubscribeAsync(events chan behavior.IEvt, transactional bool) error
func (*EventReaction) Unsubscribe ¶
func (er *EventReaction) Unsubscribe(topic string, fn OnEvtFunc) error
func (*EventReaction) UnsubscribeAll ¶
func (er *EventReaction) UnsubscribeAll(when OnEvtFunc) map[string]error
UnsubscribeAll disconnects the Reaction from all topics.
type EventStoreFtor ¶
type EventStoreFtor func() IEventStore
type EvtReactionFtor ¶
type EvtReactionFtor func() IEvtReaction
type GenBusFtor ¶
GenBusFtor is a generic functor that is discriminated by the Type of Connection and Message Type of the bus driver. that returns a IGenBus injector.
type GenCommandHandler ¶
type GenEvtReactionFtor ¶
type GenEvtReactionFtor[TEvt behavior.IEvt] func() IGenEvtReaction[TEvt]
type GenEvtReactor ¶
type GenEvtReactor[TEvt behavior.IEvt] struct { *Component // contains filtered or unexported fields }
func (*GenEvtReactor[TEvt]) Activate ¶
func (er *GenEvtReactor[TEvt]) Activate(ctx context.Context) error
func (*GenEvtReactor[TEvt]) Deactivate ¶
func (er *GenEvtReactor[TEvt]) Deactivate(ctx context.Context) error
func (*GenEvtReactor[TEvt]) GetEventType ¶
func (er *GenEvtReactor[TEvt]) GetEventType() behavior.EventType
func (*GenEvtReactor[TEvt]) React ¶
func (er *GenEvtReactor[TEvt]) React(ctx context.Context, evt TEvt) error
func (*GenEvtReactor[TEvt]) SubscribeAsync ¶
func (er *GenEvtReactor[TEvt]) SubscribeAsync(events chan TEvt, transactional bool) error
type GenMediatorLoggerFtor ¶
type GenMediatorLoggerFtor[TEvt behavior.IEvt] func() IGenMediatorLogger[TEvt]
type GenMsgReactionFtor ¶
type GenMsgReactionFtor[TMsg schema.IMsg] func() IGenMsgReaction[TMsg]
type GenProjFtor ¶
type GenProjFtor[TEvt behavior.IEvt, TState schema.ISchema] func() IGenProjection[TEvt, TState]
type GenProjection ¶
type GenProjection[TEvt behavior.IEvt, TState schema.ISchema] struct { *EventReaction // contains filtered or unexported fields }
func NewProjection ¶
func (*GenProjection[TEvt, TState]) IAmProjection ¶
func (ph *GenProjection[TEvt, TState]) IAmProjection()
type GenProjectionFtor ¶
type GenProjectionFtor[TEvt behavior.IEvt, TState schema.ISchema] func() IGenProjection[TEvt, TState]
type GenRequesterFtor ¶
type GenRequesterFtor[THope contract.IHope] func() (IGenRequester[THope], error)
type GenResponderFtor ¶
type GenResponderFtor[THope contract.IHope] func() IGenResponder[THope]
type IBehaviorStore ¶
type IBus ¶
type IBus interface { Close() Publish(ctx context.Context, topic string, data []byte) error Request(ctx context.Context, topic string, data []byte, timeout time.Duration) ([]byte, error) RequestAsync(ctx context.Context, topic string, data []byte, timeout time.Duration, responses chan []byte) func() error Listen(ctx context.Context, topic string, facts chan []byte) ListenAsync(ctx context.Context, topic string, facts chan []byte) func() error Wait() error }
IBus is an interface to a Bus. Will be replaced with IGenBus
type ICmdHandler ¶
type ICmdHandler interface { IComponent CommandHandler }
ICmdHandler is an interface to a Command Handler. Will be replaced with IGenCmdHandler
type IComponent ¶
type IComponent interface { GetMediator() mediator.IMediator GetName() schema.Name GetLogger() logger.IAppLogger GetConfig() config.IAppConfig }
type IConnection ¶
type IConnection[TConn interface{}] interface {
Connection() TConn
}
type IDeactivate ¶
type IEmitter ¶
type IEmitter interface { ISpokePlugin IMediatorReaction IAmEmitter() }
IEmitter is the injector for components that emit facts to message brokers. It specializes the IMediatorReaction as it registers at the mediator, where it listens for specific events that must be emitted from the domain to other systems.
type IEventStore ¶
type IEvtReaction ¶
type IEvtReaction interface { IMediatorReaction }
type IGenCmdHandler ¶
type IGenCmdHandler[T behavior.ICmd] interface { GenCommandHandler[T] GetTopic() behavior.Topic GetBehaviorStore() IBehaviorStore GetBehavior(ID schema.IIdentity) behavior.IBehavior SetTopic(topic behavior.Topic) }
IGenCmdHandler is a Command Handler for a specific ICmd
type IGenEvtReaction ¶
type IGenEvtReaction[TEvt behavior.IEvt] interface { IGenMediatorReaction[TEvt] }
func NewGenEvtHandler ¶
type IGenListener ¶
type IGenMediatorLogger ¶
type IGenMediatorLogger[TEvt behavior.IEvt] interface { IGenEvtReaction[TEvt] }
type IGenMediatorReaction ¶
type IGenMediatorReaction[TEvt behavior.IEvt] interface { ISpokePlugin behavior.IGetEvtType behavior.IGenReacter[TEvt] }
type IGenMsgReaction ¶
type IGenMsgReaction[TMsg schema.IMsg] interface { IMsgReaction GenWhen(ctx context.Context, msg TMsg) }
type IGenProjection ¶
type IGenProjection[TEvt behavior.IEvt, TState schema.ISchema] interface { IProjection }
type IGenRequester ¶
type IGenRequester[THope contract.IHope] interface { IRequester GenRequest(ctx context.Context, hope THope, timeout time.Duration) contract.IFbk GenRequestAsync(ctx context.Context, hope THope, timeout time.Duration) contract.IFbk }
IGenRequester is an Injector to a Hope Request Handler.
type IGenResponder ¶
type IGenResponder[THope contract.IHope] interface { IResponder }
type IListener ¶
type IListener interface { ISpokePlugin IAmFactListener() }
IListener is an injector for all components that listen for Facts on a message bus.
type IMediatorLogger ¶
type IMediatorLogger interface { IEvtReaction }
func GeneralMediatorLogger ¶
func GeneralMediatorLogger() IMediatorLogger
func NewMediatorLogger ¶
func NewMediatorLogger(topic behavior.EventType) IMediatorLogger
type IMediatorReaction ¶
type IMediatorReaction interface { ISpokePlugin behavior.IGetEvtType behavior.Reacter }
IMediatorReaction is an Injector for a mediator Subscriber. Will be replaced with IGenMediatorReaction at some point.
type IMsgReaction ¶
type IMsgReaction interface { ISpokePlugin }
type IPolicy ¶
type IPolicy interface { IMediatorReaction IAmPolicy() }
type IProjection ¶
type IProjection interface { IMediatorReaction IAmProjection() }
type IProjector ¶
type IProjector interface { ISpokePlugin behavior.Reacter Project(ctx context.Context, prefixes []string, poolSize int) error Inject(handlers ...IProjection) }
type IQueryProvider ¶
type IRequester ¶
type IResponder ¶
type IResponder interface { ISpokePlugin IAmResponder() GetHopeType() contract.HopeType }
type ISnapshotStore ¶
type ISpokePlugin ¶
type ISpokePlugin interface { IComponent IActivate IDeactivate }
ISpokePlugin is a base Injector for Spoke plugins
type MediatorLoggerFtor ¶
type MediatorLoggerFtor func() IMediatorLogger
func NewMediatorLoggerFtor ¶
func NewMediatorLoggerFtor(topic behavior.EventType) MediatorLoggerFtor
type MsgReaction ¶
type MsgReaction struct { *Component // contains filtered or unexported fields }
func NewMsgReaction ¶
func NewMsgReaction( msgType schema.MsgType, react OnMsgFunc, ) *MsgReaction
func (*MsgReaction) Deactivate ¶
func (h *MsgReaction) Deactivate(ctx context.Context) error
func (*MsgReaction) GetMsgType ¶
func (h *MsgReaction) GetMsgType() schema.MsgType
func (*MsgReaction) SubscribeAll ¶
func (*MsgReaction) SubscribeAllAsync ¶
func (*MsgReaction) SubscribeAsync ¶
func (h *MsgReaction) SubscribeAsync(msgs chan schema.IMsg, transactional bool) error
func (*MsgReaction) Unsubscribe ¶
func (h *MsgReaction) Unsubscribe(topic string, fn OnMsgFunc) error
func (*MsgReaction) UnsubscribeAll ¶
func (h *MsgReaction) UnsubscribeAll(when OnMsgFunc) map[string]error
type MsgReactionFtor ¶
type MsgReactionFtor func() IMsgReaction
type ProjectorBuilder ¶
type ProjectorBuilder func(newProj ProjectorFtor) IProjector
type ProjectorFtor ¶
type ProjectorFtor func() IProjector
type QryProvider ¶
type QryProvider[TReadModel schema.ISchema] struct { *Component // contains filtered or unexported fields }
func NewQryProvider ¶
func (*QryProvider[TReadModel]) IAmQryProvider ¶
func (p *QryProvider[TReadModel]) IAmQryProvider()
type RequesterFtor ¶
type RequesterFtor func() (IRequester, error)