Versions in this module Expand all Collapse all v0 v0.2.0 Oct 28, 2025 Changes in this version + func AnnotationSubjectConvention(ctx context.Context, m proto.Message) (string, error) + func ExecuteSubjectTemplate(template string, m proto.Message) (string, error) + func IsPersistentError(err error) bool + func NewPersistentError(err error) error v0.1.0 Oct 22, 2025 Changes in this version + const HdrContentType + const HdrCorrelationID + const HdrMsgType + const HdrNatsMsgID + const HdrNatsTimestamp + const HdrSubject + func GetContextHeader(ctx context.Context) nats.Header + func GetContextMetadata(ctx context.Context) *jetstream.MsgMetadata + func MessageType(m proto.Message) string + func NewError(err error, typ ErrorType) error + func SetContextHeader(ctx context.Context, h nats.Header) context.Context + func SetContextMetadata(ctx context.Context, md *jetstream.MsgMetadata) context.Context + func WithConsumerMiddleware(m ...MiddlewareFunc) func(*ConsumerOptions) + func WithErrorHandler(fn ErrorFunc) func(*ConsumerOptions) + func WithLogger(l *slog.Logger) func(*ConsumerOptions) + func WithPublisherMiddleware(m ...MiddlewareFunc) func(o *PublisherOptions) + func WithSubjectConvention(fn SubjectConventionFunc) func(o *PublisherOptions) + type Consumer struct + func NewConsumer(jc jetstream.Consumer, h Handler, optFns ...func(*ConsumerOptions)) (*Consumer, error) + func (c *Consumer) Close() error + type ConsumerOptions struct + ErrorFn ErrorFunc + Logger *slog.Logger + Middleware []MiddlewareFunc + Timeout time.Duration + type Error struct + func (e *Error) Error() string + func (e *Error) Unwrap() error + type ErrorFunc func(ctx context.Context, m jetstream.Msg, err error) + type ErrorType uint8 + const ErrorTypeNone + const ErrorTypePersistent + const ErrorTypeTransient + const ErrorTypeUnknown + func ErrorTypeOf(err error) ErrorType + type Handler interface + Handle func(ctx context.Context, m proto.Message) error + func ApplyMiddleware(h Handler, m ...MiddlewareFunc) Handler + type HandlerFunc func(ctx context.Context, m proto.Message) error + func (h HandlerFunc) Handle(ctx context.Context, m proto.Message) error + type MiddlewareFunc func(h Handler) Handler + func LoggingMiddleware(l *slog.Logger) MiddlewareFunc + type MsgPtr interface + type Publisher struct + func NewPublisher(js jetstream.JetStream, optFns ...func(*PublisherOptions)) *Publisher + func (p *Publisher) Publish(ctx context.Context, m proto.Message) error + type PublisherOptions struct + Middleware []MiddlewareFunc + SubjectConvention SubjectConventionFunc + type SubjectConventionFunc func(ctx context.Context, m proto.Message) (string, error) + type TypeHandler interface + Type func() string + func NewHandler[T any, PT MsgPtr[T]](fn func(ctx context.Context, m PT) error) TypeHandler