Documentation ¶
Index ¶
- Constants
- func IAmNATSBus(b INATSBus) bool
- func ResponderFtor[THope contract.IHope, TCmd behavior.ICmd](topic string, feature spokes.ISpoke, ...) comps.GenResponderFtor[THope]
- type BusFtor
- type Emitter
- type IEmitter
- type IListener
- type INATSBus
- type IRequester
- type IResponder
- type Listener
- type Requester
- func (r *Requester[THope]) GenRequest(ctx context.Context, hope THope, timeout time.Duration) contract.IFbk
- func (r *Requester[THope]) GenRequestAsync(ctx context.Context, hope THope, timeout time.Duration) contract.IFbk
- func (r *Requester[THope]) GetHopeType() contract.HopeType
- func (r *Requester[THope]) IAmRequester()
- func (r *Requester[THope]) Request(ctx context.Context, hope contract.IHope, timeout time.Duration) contract.IFbk
- func (r *Requester[THope]) RequestAsync(ctx context.Context, hope contract.IHope, timeout time.Duration) contract.IFbk
- type Responder
Constants ¶
View Source
const (
BusFmt = "[%v].NATS.New"
)
View Source
const (
ListenerFmt = "%+v.NATSListener"
)
View Source
const (
RequesterFmt = "NATS.Requester(%+v)"
)
Variables ¶
This section is empty.
Functions ¶
func IAmNATSBus ¶
func ResponderFtor ¶
func ResponderFtor[THope contract.IHope, TCmd behavior.ICmd]( topic string, feature spokes.ISpoke, hope2Cmd behavior.Hope2CmdFunc[THope, TCmd], ) comps.GenResponderFtor[THope]
ResponderFtor is a generic functor that is discriminated by the feature's specific IHope and ICmd injectors.
Types ¶
type BusFtor ¶
func SingleNATS ¶
func SingleNATS(config config.IAppConfig) BusFtor
SingleNATS returns functor that produces a guaranteed singleton instance of the NATS bus.
func TransientNATS ¶
func TransientNATS(config config.IAppConfig) BusFtor
TransientNATS returns functor that produces a transient instance of the NATS bus.
type Emitter ¶
type Emitter struct { *comps.EventReaction Topic behavior.EventType // contains filtered or unexported fields }
func NewEmitter ¶
func (*Emitter) IAmEmitter ¶
func (e *Emitter) IAmEmitter()
type IRequester ¶
type IRequester[THope contract.IHope] interface { comps.IGenRequester[THope] }
type IResponder ¶
func NewResponder ¶
func NewResponder[THope contract.IHope, TCmd behavior.ICmd]( topic string, h2c behavior.Hope2CmdFunc[THope, TCmd]) (IResponder[THope, TCmd], error)
type Listener ¶
type Listener[TCmd behavior.ICmd] struct { *comps.Component Topic string // contains filtered or unexported fields }
func NewListener ¶
func (*Listener[TCmd]) IAmListener ¶
func (l *Listener[TCmd]) IAmListener()
type Requester ¶
type Requester[THope contract.IHope] struct { *comps.Component Topic string // contains filtered or unexported fields }
func NewRequester ¶
func (*Requester[THope]) GenRequest ¶
func (*Requester[THope]) GenRequestAsync ¶
func (*Requester[THope]) GetHopeType ¶
func (*Requester[THope]) IAmRequester ¶
func (r *Requester[THope]) IAmRequester()
type Responder ¶
type Responder[THope contract.IHope, TCmd behavior.ICmd] struct { *comps.Component Topic string // contains filtered or unexported fields }
func (*Responder[THope, TCmd]) Deactivate ¶
Deactivate is called when the component is deactivated
func (*Responder[THope, TCmd]) GetHopeType ¶
func (*Responder[THope, TCmd]) IAmResponder ¶
func (r *Responder[THope, TCmd]) IAmResponder()
Click to show internal directories.
Click to hide internal directories.