|
|
@ -41,3 +41,9 @@ func Must(ctx context.Context) *service.Container { |
|
|
|
func ServiceContainer(container *service.Container) goweb.Middleware { |
|
|
|
return middleware.WithValue(KeyServiceContainer, container) |
|
|
|
} |
|
|
|
|
|
|
|
// WithContainer returns a new context.Context with the given *service.Container
|
|
|
|
// attached.
|
|
|
|
func WithContainer(ctx context.Context, container *service.Container) context.Context { |
|
|
|
return context.WithValue(ctx, KeyServiceContainer, container) |
|
|
|
} |