MCPcopy Create free account
hub / github.com/OverloadBlitz/cloudcent-cli / attrMatch

Function attrMatch

internal/tui/views/pricing.go:590–609  ·  view source on GitHub ↗
(item PricingDisplayItem, tags []string)

Source from the content-addressed store, hash-verified

588}
589
590func attrMatch(item PricingDisplayItem, tags []string) bool {
591 if len(tags) == 0 {
592 return true
593 }
594 parts := make([]string, 0, len(item.Attrs))
595 for k, v := range item.Attrs {
596 val := ""
597 if v != nil {
598 val = *v
599 }
600 parts = append(parts, strings.ToLower(k)+"="+strings.ToLower(val))
601 }
602 flat := strings.Join(parts, " ")
603 for _, t := range tags {
604 if !strings.Contains(flat, t) {
605 return false
606 }
607 }
608 return true
609}
610
611func priceMatch(item PricingDisplayItem, priceTags []string) bool {
612 if len(priceTags) == 0 {

Callers 1

FilterItemsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected