Versions in this module Expand all Collapse all v0 v0.1.0 Aug 13, 2026 Changes in this version + const ReasonDeserializationFailed + const ReasonMaxAttemptsExceeded + const ReasonPermanent + func AsDiscard(err error) error + func AsPermanent(err error) error + func AsRetryable(err error) error + func IsDiscard(err error) bool + func IsPermanent(err error) bool + func IsRetryable(err error) bool + func RegisterHandler[T any](c *Consumer, def EventDef, h Handler[T]) error + func RegisterRawHandler(c *Consumer, sel TopicSelector, h Handler[json.RawMessage]) error + type Config struct + Consumer ConsumerConfig + Redis RedisConfig + Retry RetryConfig + Source string + StreamPrefix string + Telemetry TelemetryConfig + func (c *Config) Validate() error + type Consumer struct + func NewConsumer(cfg Config) (*Consumer, error) + func (c *Consumer) Close() error + func (c *Consumer) Run(ctx context.Context) error + type ConsumerConfig struct + ClaimInterval time.Duration + ClaimMinIdle time.Duration + Concurrency int + ConsumerName string + Group string + MaxDeliveryAttempts int + ShutdownTimeout time.Duration + type DeadLetter struct + ConsumerGroup string + ConsumerName string + DeadLetteredAt time.Time + DeliveryAttempts int64 + Error string + Event json.RawMessage + EventRaw []byte + OriginalTopic string + Reason string + type Envelope struct + CorrelationID string + EventID string + EventType string + Payload T + SchemaVersion string + Source string + Timestamp time.Time + type EventDef struct + Topic string + Type string + Version string + type Handler interface + Handle func(context.Context, Envelope[T]) error + type PublishOption func(*publishOptions) + func WithCorrelationID(id string) PublishOption + type PublishResult struct + EventID string + Timestamp time.Time + type Publisher struct + func NewPublisher(cfg Config) (*Publisher, error) + func (p *Publisher) Close() error + func (p *Publisher) Publish(ctx context.Context, def EventDef, payload any, opts ...PublishOption) (PublishResult, error) + type RedisConfig struct + Address string + DB int + Password string + PoolSize int + TLS *tls.Config + Username string + type RetryConfig struct + InitialBackoff time.Duration + MaxBackoff time.Duration + MaxImmediateRetries int + type TelemetryConfig struct + LogPayloads bool + Logger *slog.Logger + MeterProvider metric.MeterProvider + Propagator propagation.TextMapPropagator + TracerProvider trace.TracerProvider + type TopicSelector struct + Topic string