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

Method LoadSnapshot

pkg/store/json.go:220–231  ·  view source on GitHub ↗

LoadSnapshot 加载快照

(ctx context.Context, agentID string, snapshotID string)

Source from the content-addressed store, hash-verified

218
219// LoadSnapshot 加载快照
220func (js *JSONStore) LoadSnapshot(ctx context.Context, agentID string, snapshotID string) (*types.Snapshot, error) {
221 js.mu.RLock()
222 defer js.mu.RUnlock()
223
224 var snapshot types.Snapshot
225 path := filepath.Join(js.agentDir(agentID), "snapshots", snapshotID+".json")
226 if err := js.loadJSON(path, &snapshot); err != nil {
227 return nil, err
228 }
229
230 return &snapshot, nil
231}
232
233// ListSnapshots 列出快照
234func (js *JSONStore) ListSnapshots(ctx context.Context, agentID string) ([]types.Snapshot, error) {

Callers

nothing calls this directly

Calls 3

agentDirMethod · 0.95
loadJSONMethod · 0.95
JoinMethod · 0.45

Tested by

no test coverage detected