Boost Extra Middleware

•
12
•

Composes custom middleware chains for Go applications when standard bootstrap presets cannot be used.

This skill provides guidance and implementation patterns for using the extra/middleware package within the Boost framework. It specializes in the NewAnyErrorWrapper[T] function, enabling developers to build robust, manually-composed middleware chains that include recovery, logging, and publishing. It is primarily utilized as a production workaround for context loss in Pub/Sub adapters or when implementing custom drivers that require the same standard middleware semantics as fn.Run but outside the default bootstrap flow, ensuring consistency and reliability in non-standard event-driven architectures.

주요 기능

01Manually compose middleware chains using NewAnyErrorWrapper[T]
02Supports generic handler types using Go type parameters
03Provides documented workarounds for Pub/Sub and NATS adapter context loss
04Implements standard recovery, logger, and publisher middleware semantics
0512 GitHub stars
06Ensures consistent middleware ordering across custom drivers

사용 사례

01Manually driving wrapped handlers outside of the standard fn.Run lifecycle
02Building custom event drivers that require standard Boost middleware
03Implementing the Pub/Sub adapter workaround to prevent context loss