Versions in this module Expand all Collapse all v0 v0.1.0 Oct 18, 2026 Changes in this version + var ErrClosed = errors.New("messaging: closed") + var ErrConsumerExists = errors.New("messaging: consumer exists") + var ErrDeliverySettled = errors.New("messaging: delivery settled") + var ErrInvalidEnvelope = errors.New("messaging: invalid envelope") + var ErrInvalidSubscription = errors.New("messaging: invalid subscription") + var ErrNilDependency = errors.New("messaging: nil dependency") + var ErrUnauthorized = errors.New("messaging: unauthorized") + type AuthorizationRequest struct + Action string + Attributes map[string]string + Subject string + type AuthorizedPublisher struct + func NewAuthorizedPublisher[T any](next Publisher[T], authorizer Authorizer) (*AuthorizedPublisher[T], error) + func (publisher *AuthorizedPublisher[T]) Publish(ctx context.Context, envelope Envelope[T]) error + type AuthorizedSubscriber struct + func NewAuthorizedSubscriber[T any](next Subscriber[T], authorizer Authorizer) (*AuthorizedSubscriber[T], error) + func (subscriber *AuthorizedSubscriber[T]) Subscribe(ctx context.Context, subscription Subscription, handler Handler[T]) error + type Authorizer interface + Authorize func(context.Context, AuthorizationRequest) error + type Delivery interface + Ack func(context.Context) error + Attempt func() uint + Envelope func() Envelope[T] + Nack func(context.Context, error) error + type DeliverySemantics uint8 + const AtLeastOnce + const AtMostOnce + type Envelope struct + Headers map[string]string + ID MessageID + Payload T + SentAt time.Time + Subject string + func NewEnvelope[T any](subject string, payload T) (Envelope[T], error) + func (envelope Envelope[T]) Clone() Envelope[T] + func (envelope Envelope[T]) Validate() error + func (envelope Envelope[T]) WithHeader(key, value string) (Envelope[T], error) + type FanoutPublisher struct + func NewFanoutPublisher[T any](publishers []Publisher[T], maxParallel int) (*FanoutPublisher[T], error) + func (publisher *FanoutPublisher[T]) Publish(ctx context.Context, envelope Envelope[T]) error + type Handler func(context.Context, Delivery[T]) error + type HandlerRequester struct + func NewHandlerRequester[Req, Resp any](handler RequestHandler[Req, Resp]) (*HandlerRequester[Req, Resp], error) + func (requester *HandlerRequester[Req, Resp]) Request(ctx context.Context, request Envelope[Req]) (Envelope[Resp], error) + type MessageID string + func NewMessageID() (MessageID, error) + type Publisher interface + Publish func(context.Context, Envelope[T]) error + type RequestHandler func(context.Context, Envelope[Req]) (Envelope[Resp], error) + type Requester interface + Request func(context.Context, Envelope[Req]) (Envelope[Resp], error) + type Stream interface + Close func() error + Receive func(context.Context) (Envelope[T], error) + Send func(context.Context, Envelope[T]) error + type Subscriber interface + Subscribe func(context.Context, Subscription, Handler[T]) error + type Subscription struct + Consumer string + MaxInFlight int + Semantics DeliverySemantics + Subject string + func (subscription Subscription) Validate() error