Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var MissingHandler = fmt.Errorf("error missing handler")
Functions ¶
This section is empty.
Types ¶
type Consumer ¶
type Consumer interface {
Ping(ctx context.Context) error
Use(middlewareFunc ...MiddlewareFunc)
Listen()
Subscribe(topic string, dispatcher Dispatcher) error
Close() error
}
type DispatchDTO ¶
type DispatchType ¶
type DispatchType string
const ( Handle DispatchType = "handle" Error DispatchType = "error" )
type Dispatcher ¶
type Dispatcher interface {
AddHandler(handler HandlerFunc, errorHandler ErrorHandlerFunc, msgType ...string)
Use(middlewareFunc ...MiddlewareFunc)
Dispatch(dto DispatchDTO, middlewareFunc ...MiddlewareFunc) error
}
func NewMultiEventDispatcher ¶
func NewMultiEventDispatcher() Dispatcher
func NewSingleEventDispatcher ¶
func NewSingleEventDispatcher() Dispatcher
type Message ¶
type Message struct {
Ordering string `json:"ordering"`
Data []byte `json:"data"`
Attributes map[string]string `json:"attributes"`
// contains filtered or unexported fields
}
func (Message) MarshalJSON ¶
func (*Message) UnmarshalJSON ¶
type MessageQueue ¶
func NoopQueue ¶
func NoopQueue() MessageQueue
type MiddlewareFunc ¶
type MiddlewareFunc func(MiddlewareHandlerFunc) MiddlewareHandlerFunc
type MiddlewareHandlerFunc ¶
type MiddlewareHandlerFunc func(ctx context.Context, dto DispatchDTO) error
Click to show internal directories.
Click to hide internal directories.