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

Method SaveInfo

pkg/store/json.go:266–276  ·  view source on GitHub ↗

SaveInfo 保存Agent元信息

(ctx context.Context, agentID string, info types.AgentInfo)

Source from the content-addressed store, hash-verified

264
265// SaveInfo 保存Agent元信息
266func (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元信息
279func (js *JSONStore) LoadInfo(ctx context.Context, agentID string) (*types.AgentInfo, error) {

Callers 1

mainFunction · 0.95

Calls 4

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

Tested by

no test coverage detected