You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
decort-golang-sdk/pkg/cloudapi/disks/ids.go

28 lines
644 B

package disks
// IDs gets array of DiskIDs from ListDisks struct
func (ld ListDisks) IDs() []uint64 {
res := make([]uint64, 0, len(ld.Data))
for _, d := range ld.Data {
res = append(res, d.ID)
}
return res
}
// IDs gets array of DiskIDs from ListDisksUnattached struct
func (ldu ListDisksUnattached) IDs() []uint64 {
res := make([]uint64, 0, len(ldu.Data))
for _, d := range ldu.Data {
res = append(res, d.ID)
}
return res
}
// IDs gets array of DiskIDs from ListSearchDisks struct
func (lsd ListSearchDisks) IDs() []uint64 {
res := make([]uint64, 0, len(lsd))
for _, d := range lsd {
res = append(res, d.ID)
}
return res
}