Clarify shared ownership of namespace views

This commit is contained in:
2026-10-17 13:52:50 +00:00
parent 6fff3d822c
commit 8627c751a4
4 changed files with 31 additions and 10 deletions

View File

@@ -23,6 +23,10 @@ type Namespaces struct {
// inspection are not rewritten. [Engine.ListNamespaces] and
// [Engine.ListCollections] remain global inventories. Invalid namespace syntax
// or a nil engine returns an error matching ErrInvalidConfig.
//
// The view shares the receiver's captured configuration, clients, backend-capacity
// pools, and prepared-execution owner. Prepared handles retain their captured
// selections whichever related view executes them.
func (e *Engine) WithNamespaces(namespaces Namespaces) (*Engine, error) {
if e == nil || e.internal == nil {
return nil, fmt.Errorf("%w: engine is nil", ErrInvalidConfig)