Versions in this module Expand all Collapse all v0 v0.2.0 Jul 21, 2026 Changes in this version type RouterOption + func WithMetrics(mp ...metric.MeterProvider) RouterOption + func WithPropagator(p propagation.TextMapPropagator) RouterOption + func WithTracing(tp ...trace.TracerProvider) RouterOption v0.1.0 Jul 21, 2026 Changes in this version + var ErrAlreadyRunning = errors.New("shunt: router is already running") + var ErrNoTopics = errors.New("shunt: no topics registered") + type BackoffConfig struct + Initial time.Duration + Jitter float64 + Max time.Duration + Multiplier float64 + type Claim interface + Messages func() <-chan *sarama.ConsumerMessage + Partition func() int32 + Topic func() string + type HandlerFunc func(ctx context.Context, msg *Message) error + type Header struct + Key string + Value []byte + type Message struct + Headers []Header + Key []byte + Offset int64 + Partition int32 + Retry *RetryMeta + Timestamp time.Time + Topic string + Value []byte + type Producer interface + Close func() error + SendMessage func(msg *sarama.ProducerMessage) (partition int32, offset int64, err error) + type RetryMeta struct + Attempts int + LastError string + NotBefore time.Time + OriginalOffset int64 + OriginalPartition int32 + OriginalTopic string + Step int + StepAttempt int + type RetryStep struct + func InProcess(attempts int) RetryStep + func InProcessWithBackoff(attempts int, cfg BackoffConfig) RetryStep + func RetryTopic(name string, delay time.Duration, attempts int) RetryStep + type Router struct + func New(brokers []string, groupID string, opts ...RouterOption) (*Router, error) + func (r *Router) Register(topics ...*Topic) *Router + func (r *Router) Run() error + func (r *Router) Shutdown(ctx context.Context) error + type RouterOption func(*Router) + func WithLogger(logger *slog.Logger) RouterOption + func WithSaramaConfig(cfg *sarama.Config) RouterOption + func WithWorkers(n int) RouterOption + type Session interface + Context func() context.Context + MarkMessage func(msg *sarama.ConsumerMessage, metadata string) + type Topic struct + func NewTopic(name string, handler HandlerFunc, opts ...TopicOption) *Topic + func (t *Topic) Name() string + type TopicOption func(*Topic) + func WithDLQ(topic string) TopicOption + func WithRetry(steps ...RetryStep) TopicOption + func WithTopicWorkers(n int) TopicOption