Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewErrorRecorderInterceptor ¶
func NewErrorRecorderInterceptor(registry ErrorRecorder) connect.UnaryInterceptorFunc
NewErrorRecorderInterceptor returns a ConnectRPC unary interceptor that records errors as OTel span events with the error message, first 5 stack frames, and RPC procedure name. It is safe to use when OTel is not configured (span.IsRecording() returns false and the span recording block is a no-op).
When registry is non-nil, every error is also persisted to SQLite via registry.Record for the /ListErrors and /AcknowledgeError RPCs.
func NewFeatureFlagInterceptor ¶
func NewFeatureFlagInterceptor(flagName string, isEnabled func() bool) connect.UnaryInterceptorFunc
NewFeatureFlagInterceptor returns a ConnectRPC unary interceptor that returns connect.CodeNotFound when isEnabled reports false. Use this to gate an entire service handler behind a runtime feature flag so that unauthenticated API calls are rejected even if the caller bypasses the frontend redirect.
isEnabled is called on every request so flag changes are reflected immediately without a server restart. The recommended implementation is:
func() bool { return config.LoadConfig().GetFeatureFlag("backlog") }