Documentation
¶
Index ¶
- type Handler
- type HandlerFunc
- type HandlerOption
- type MiddlewareFunc
- type Registry
- func (r *Registry) Execute(topic string, payload json.RawMessage) error
- func (r *Registry) Get(topic string) (*Handler, bool)
- func (r *Registry) Has(topic string) bool
- func (r *Registry) Register(topic string, fn HandlerFunc, payloadType interface{}) error
- func (r *Registry) Remove(topic string)
- func (r *Registry) Topics() []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func NewHandler(fn HandlerFunc, payloadType interface{}, opts ...HandlerOption) *Handler
func (*Handler) MaxRetries ¶
type HandlerFunc ¶
type HandlerFunc func(payload interface{}) error
HandlerFunc is the function signature for task handlers
type HandlerOption ¶
type HandlerOption func(*Handler)
func WithMaxRetries ¶
func WithMaxRetries(retries int) HandlerOption
func WithMiddleware ¶
func WithMiddleware(middleware ...MiddlewareFunc) HandlerOption
func WithTimeout ¶
func WithTimeout(timeout time.Duration) HandlerOption
type MiddlewareFunc ¶
type MiddlewareFunc func(next HandlerFunc) HandlerFunc
Click to show internal directories.
Click to hide internal directories.