Merge remote-tracking branch 'origin/v3' into v3
All checks were successful
lint / lint (pull_request) Successful in 1m0s
test / test (pull_request) Successful in 3m29s

This commit is contained in:
2024-12-18 10:51:08 +03:00
16 changed files with 162 additions and 45 deletions

View File

@@ -15,6 +15,15 @@ func FromContext(ctx context.Context) (Broker, bool) {
return c, ok
}
// MustContext returns broker from passed context
func MustContext(ctx context.Context) Broker {
b, ok := FromContext(ctx)
if !ok {
panic("missing broker")
}
return b
}
// NewContext savess broker in context
func NewContext(ctx context.Context, s Broker) context.Context {
if ctx == nil {