MCPcopy Create free account
hub / github.com/astercloud/aster / Delete

Method Delete

pkg/memory/logic/store_inmemory.go:85–96  ·  view source on GitHub ↗

Delete 删除 Memory

(ctx context.Context, namespace, key string)

Source from the content-addressed store, hash-verified

83
84// Delete 删除 Memory
85func (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
99func (s *InMemoryStore) List(ctx context.Context, namespace string, filters ...Filter) ([]*LogicMemory, error) {

Callers 1

Calls 2

deleteFunction · 0.85
makeKeyFunction · 0.70

Tested by 1