MCPcopy
hub / github.com/weaviate/weaviate / RemoveEntity

Method RemoveEntity

usecases/namespaces/controller.go:200–212  ·  view source on GitHub ↗

RemoveEntity removes the namespace map entry. Callable only on a namespace already marked for deletion; an active namespace returns [ErrInvalidState]. Returns [ErrNotFound] when the namespace does not exist.

(name string)

Source from the content-addressed store, hash-verified

198// namespace already marked for deletion; an active namespace returns
199// [ErrInvalidState]. Returns [ErrNotFound] when the namespace does not exist.
200func (c *Controller) RemoveEntity(name string) error {
201 c.mu.Lock()
202 defer c.mu.Unlock()
203 ns, ok := c.namespaces[name]
204 if !ok {
205 return fmt.Errorf("%w: %q", ErrNotFound, name)
206 }
207 if ns.State != cmd.NamespaceStateDeleting {
208 return fmt.Errorf("%w: %q is not in deleting state", ErrInvalidState, name)
209 }
210 delete(c.namespaces, name)
211 return nil
212}
213
214// Get returns the named namespaces. An empty Names slice returns all known
215// namespaces; otherwise only the named ones that exist are returned (missing

Callers 3

TestController_ExistsFunction · 0.45

Implementers 6

MockControllerusecases/auth/authorization/mock_contr
MockController_Expecterusecases/auth/authorization/mock_contr
Managerusecases/auth/authorization/rbac/manag
MockControllerAndGetUsersadapters/handlers/rest/authz/mock_cont
MockControllerAndGetUsers_Expecteradapters/handlers/rest/authz/mock_cont
Raftcluster/raft.go

Calls 4

ErrorfMethod · 0.80
LockMethod · 0.65
UnlockMethod · 0.65
deleteFunction · 0.50

Tested by 3

TestController_ExistsFunction · 0.36