Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithNoDefinedEndpoints ¶
Types ¶
type Executor ¶
type Executor func(execCtx MessageExecutionCtx) error
Executor is a callback that will be called on received message with context. it should return an error only if internal server error happened, in case of business errors it's best to send a failure event.
type MessageExecutionCtx ¶
type MessageExecutionCtx interface {
// Message returns received message
Message() *message.ReceivedMessage
// Context returns parent execution context. Each message has own time limit in which it must be processed.
Context() context.Context
// Valid Deprecated
Valid() bool
// Send sends an out coming message to registered endpoints
Send(message *message.OutcomingMessage, options ...endpoint.DeliveryOption) error
// Return sends received message to registered endpoints and updates number of returns in headers
Return(options ...endpoint.DeliveryOption) error
// LogMessage allows to log message in handlers
LogMessage(level log.Level, msg string)
}
MessageExecutionCtx is passed to each executor and contains received message, ctx, knows how to send out or return a message.
type MessageExecutionCtxFactory ¶
type MessageExecutionCtxFactory interface {
CreateCtx(ctx context.Context, inPkg transport.IncomingPkg, message *message.ReceivedMessage) MessageExecutionCtx
}
func NewMessageExecutionCtxFactory ¶
func NewMessageExecutionCtxFactory(router endpoint.Router, logger log.Logger) MessageExecutionCtxFactory
type NoDefinedEndpoints ¶
type NoDefinedEndpoints struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.