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

Method SaveTodos

pkg/store/json.go:293–303  ·  view source on GitHub ↗

SaveTodos 保存Todo列表

(ctx context.Context, agentID string, todos any)

Source from the content-addressed store, hash-verified

291
292// SaveTodos 保存Todo列表
293func (js *JSONStore) SaveTodos(ctx context.Context, agentID string, todos any) error {
294 js.mu.Lock()
295 defer js.mu.Unlock()
296
297 if err := js.ensureAgentDir(agentID); err != nil {
298 return err
299 }
300
301 path := filepath.Join(js.agentDir(agentID), "todos.json")
302 return js.saveJSON(path, todos)
303}
304
305// LoadTodos 加载Todo列表
306func (js *JSONStore) LoadTodos(ctx context.Context, agentID string) (any, error) {

Callers

nothing calls this directly

Calls 4

ensureAgentDirMethod · 0.95
agentDirMethod · 0.95
saveJSONMethod · 0.95
JoinMethod · 0.45

Tested by

no test coverage detected