Release URBM 2026.06.15.r008

This commit is contained in:
Mikei386
2026-06-15 07:17:37 +02:00
parent b0fa11a40a
commit 5e68a50373
13 changed files with 143 additions and 14 deletions
+22
View File
@@ -91,6 +91,12 @@ type Progress struct {
type ProgressCallback func(Progress)
type Stats struct {
TotalSize int64 `json:"total_size"`
TotalFileCount int64 `json:"total_file_count"`
TotalBlobCount int64 `json:"total_blob_count"`
}
func (r *Runner) Init(ctx context.Context, repo model.Repository) error {
return r.run(ctx, repo, []string{"init"}, nil, nil)
}
@@ -191,6 +197,22 @@ func (r *Runner) Snapshots(ctx context.Context, repo model.Repository) ([]model.
return snapshots, nil
}
func (r *Runner) Stats(ctx context.Context, repo model.Repository, mode string) (Stats, error) {
args := []string{"stats", "--json"}
if mode != "" {
args = append(args, "--mode", mode)
}
var output []byte
if err := r.run(ctx, repo, args, nil, &output); err != nil {
return Stats{}, err
}
var stats Stats
if err := json.Unmarshal(output, &stats); err != nil {
return Stats{}, fmt.Errorf("decode repository stats: %w", err)
}
return stats, nil
}
func (r *Runner) List(ctx context.Context, repo model.Repository, snapshot, path string) ([]map[string]any, error) {
args := []string{"ls", snapshot, "--json"}
if path != "" {