Delete 删除 Memory
(ctx context.Context, namespace, key string)
| 83 | |
| 84 | // Delete 删除 Memory |
| 85 | func (s *InMemoryStore) Delete(ctx context.Context, namespace, key string) error { |
| 86 | s.mu.Lock() |
| 87 | defer s.mu.Unlock() |
| 88 | |
| 89 | if s.closed { |
| 90 | return ErrStoreClosed |
| 91 | } |
| 92 | |
| 93 | storeKey := makeKey(namespace, key) |
| 94 | delete(s.memories, storeKey) |
| 95 | return nil |
| 96 | } |
| 97 | |
| 98 | // List 列出符合条件的 Memory |
| 99 | func (s *InMemoryStore) List(ctx context.Context, namespace string, filters ...Filter) ([]*LogicMemory, error) { |