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

Method GetMemory

pkg/memory/logic/manager.go:180–192  ·  view source on GitHub ↗

GetMemory 获取单个 Memory

(ctx context.Context, namespace, key string)

Source from the content-addressed store, hash-verified

178
179// GetMemory 获取单个 Memory
180func (m *Manager) GetMemory(ctx context.Context, namespace, key string) (*LogicMemory, error) {
181 memory, err := m.store.Get(ctx, namespace, key)
182 if err != nil {
183 return nil, err
184 }
185
186 // 更新访问计数
187 go func() {
188 _ = m.store.IncrementAccessCount(context.Background(), namespace, key)
189 }()
190
191 return memory, nil
192}
193
194// DeleteMemory 删除 Memory
195func (m *Manager) DeleteMemory(ctx context.Context, namespace, key string) error {

Callers 2

basicUsageExampleFunction · 0.95
getMethod · 0.45

Calls 2

GetMethod · 0.65
IncrementAccessCountMethod · 0.65

Tested by

no test coverage detected