This commit is contained in:
2023-11-03 11:17:45 +03:00
parent 4120cd2b1a
commit 84c0248019
40 changed files with 964 additions and 73 deletions

19
pkg/cloudapi/image/ids.go Normal file
View File

@@ -0,0 +1,19 @@
package image
// IDs gets array of ImageIDs from ListImages struct
func (li ListImages) IDs() []uint64 {
res := make([]uint64, 0, len(li.Data))
for _, i := range li.Data {
res = append(res, i.ID)
}
return res
}
// IDs gets array of HistoryIDs from ListHistories struct
func (lh ListHistories) IDs() []uint64 {
res := make([]uint64, 0, len(lh))
for _, h := range lh {
res = append(res, h.ID)
}
return res
}

View File

@@ -66,7 +66,10 @@ type ListImages struct {
EntryCount uint64 `json:"entryCount"`
}
// History
// ListHistories of record image
type ListHistories []History
// History of record image
type History struct {
// GUID
GUID string `json:"guid"`
@@ -123,7 +126,7 @@ type RecordImage struct {
GUID uint64 `json:"guid"`
// History
History []History `json:"history"`
History ListHistories `json:"history"`
// HotResize
HotResize bool `json:"hotResize"`