draft of compute units catalog
This commit is contained in:
parent
8f2adb76e4
commit
9e52663261
@ -25,6 +25,7 @@ type ResourceInstanceITF interface {
|
|||||||
GetPricingsProfiles(peerID string, groups []string) []pricing.PricingProfileITF
|
GetPricingsProfiles(peerID string, groups []string) []pricing.PricingProfileITF
|
||||||
GetPeerGroups() ([]ResourcePartnerITF, []map[string][]string)
|
GetPeerGroups() ([]ResourcePartnerITF, []map[string][]string)
|
||||||
ClearPeerGroups()
|
ClearPeerGroups()
|
||||||
|
GetPartnerships(peerID string, groups []string) []ResourcePartnerITF
|
||||||
}
|
}
|
||||||
|
|
||||||
type ResourcePartnerITF interface {
|
type ResourcePartnerITF interface {
|
||||||
|
@ -159,6 +159,20 @@ func (ri *ResourceInstance[T]) ClearEnv() {
|
|||||||
ri.Outputs = []models.Param{}
|
ri.Outputs = []models.Param{}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (ri *ResourceInstance[T]) GetPartnerships(peerID string, groups []string) []ResourcePartnerITF {
|
||||||
|
partners := []ResourcePartnerITF{}
|
||||||
|
for _, p := range ri.Partnerships {
|
||||||
|
if p.GetPeerGroups()[peerID] != nil {
|
||||||
|
for _, g := range p.GetPeerGroups()[peerID] {
|
||||||
|
if slices.Contains(groups, g) {
|
||||||
|
partners = append(partners, p)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return partners
|
||||||
|
}
|
||||||
|
|
||||||
func (ri *ResourceInstance[T]) GetPricingsProfiles(peerID string, groups []string) []pricing.PricingProfileITF {
|
func (ri *ResourceInstance[T]) GetPricingsProfiles(peerID string, groups []string) []pricing.PricingProfileITF {
|
||||||
pricings := []pricing.PricingProfileITF{}
|
pricings := []pricing.PricingProfileITF{}
|
||||||
for _, p := range ri.Partnerships {
|
for _, p := range ri.Partnerships {
|
||||||
|
Loading…
Reference in New Issue
Block a user