registry

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 12, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

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) Execute

func (h *Handler) Execute(payload json.RawMessage) error

func (*Handler) MaxRetries

func (h *Handler) MaxRetries() int

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

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

func New

func New() *Registry

func (*Registry) Execute

func (r *Registry) Execute(topic string, payload json.RawMessage) error

func (*Registry) Get

func (r *Registry) Get(topic string) (*Handler, bool)

func (*Registry) Has

func (r *Registry) Has(topic string) bool

func (*Registry) Register

func (r *Registry) Register(topic string, fn HandlerFunc, payloadType interface{}) error

func (*Registry) Remove

func (r *Registry) Remove(topic string)

func (*Registry) Topics

func (r *Registry) Topics() []string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL