add new list command (#97)

This commit is contained in:
Patrick Devine
2023-07-18 09:09:45 -07:00
committed by GitHub
parent da7ddbb4dc
commit 5bea29f610
10 changed files with 450 additions and 11 deletions

View File

@@ -59,6 +59,15 @@ type RootFS struct {
DiffIDs []string `json:"diff_ids"`
}
func (m *ManifestV2) GetTotalSize() int {
var total int
for _, layer := range m.Layers {
total += layer.Size
}
total += m.Config.Size
return total
}
func GetManifest(mp ModelPath) (*ManifestV2, error) {
fp, err := mp.GetManifestPath(false)
if err != nil {