SaveInfo 保存Agent元信息
(ctx context.Context, agentID string, info types.AgentInfo)
| 264 | |
| 265 | // SaveInfo 保存Agent元信息 |
| 266 | func (js *JSONStore) SaveInfo(ctx context.Context, agentID string, info types.AgentInfo) error { |
| 267 | js.mu.Lock() |
| 268 | defer js.mu.Unlock() |
| 269 | |
| 270 | if err := js.ensureAgentDir(agentID); err != nil { |
| 271 | return err |
| 272 | } |
| 273 | |
| 274 | path := filepath.Join(js.agentDir(agentID), "info.json") |
| 275 | return js.saveJSON(path, info) |
| 276 | } |
| 277 | |
| 278 | // LoadInfo 加载Agent元信息 |
| 279 | func (js *JSONStore) LoadInfo(ctx context.Context, agentID string) (*types.AgentInfo, error) { |
no test coverage detected