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/k8s/ids.go

29 lines
669 B

package k8s
// IDs gets array of K8SIDs from ListK8SClusters struct
func (lk ListK8SClusters) IDs() []uint64 {
res := make([]uint64, 0, len(lk.Data))
for _, k := range lk.Data {
res = append(res, k.ID)
}
return res
}
// IDs gets array of K8SWorkerGroupIDs from ListK8SGroups struct
func (lwg ListK8SGroups) IDs() []uint64 {
res := make([]uint64, 0, len(lwg))
for _, wg := range lwg {
res = append(res, wg.ID)
}
return res
}
// IDs gets array of Worker or Master ComputesIDs from ListDetailedInfo struct
func (ldi ListDetailedInfo) IDs() []uint64 {
res := make([]uint64, 0, len(ldi))
for _, di := range ldi {
res = append(res, di.ID)
}
return res
}