Documentation ¶
Index ¶
- Constants
- func Acker(h xpubsub.Handler) xpubsub.Handler
- func ContextMetadata(next xpubsub.Handler) xpubsub.Handler
- func CtxSubject(ctx context.Context) string
- func CtxSubscriptionID(ctx context.Context) string
- func GetMessageID(ctx context.Context) string
- func Logger(next xpubsub.Handler) xpubsub.Handler
- func MessageID(next xpubsub.Handler) xpubsub.Handler
- func Recoverer(h xpubsub.Handler) xpubsub.Handler
Constants ¶
const MessageIDKey ctxKeyMessageID = 0
MessageIDKey is the key that holds the unique request ID in a request context.
Variables ¶
This section is empty.
Functions ¶
func Acker ¶
Acker is a middleware that checks if the subsequent handlers returns an error and on success ackes them. In case of failure it Nacks the message if it is possible.
func ContextMetadata ¶
ContextMetadata sets up the metadata from the message in the context.
func CtxSubject ¶
CtxSubject gets the subscription subject from the given context.
func CtxSubscriptionID ¶
CtxSubscriptionID gets the subscription id from the given context.
func GetMessageID ¶
GetMessageID returns a message ID from the given context if one is present. Returns the empty string if a message ID cannot be found.
func Logger ¶
Logger is a middleware function that is used for trace logging incoming message on subscriptions.
func MessageID ¶
MessageID is a middleware function that generates new request id and puts it into message context, A message ID is a string of the form "host.example.com/random-0001", where "random" is a base62 random string that uniquely identifies this go process, and where the last number is an atomically incremented request counter. The concept and implementation of this request id is based on the brilliant golang library: github.com/go-chi/chi.
Types ¶
This section is empty.