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

Method submitPricingQuery

internal/tui/app.go:418–441  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

416}
417
418func (a App) submitPricingQuery() (tea.Model, tea.Cmd) {
419 if a.pricingView.Loading {
420 return a, nil
421 }
422 b := &a.pricingView.CommandBuilder
423 products := append([]string{}, b.ProductTags...)
424 regions := append([]string{}, b.RegionTags...)
425 prices := append([]string{}, b.PriceTags...)
426 attrsMap := map[string]string{}
427 for _, tag := range b.AttributeTags {
428 if k, v, ok := strings.Cut(tag, "="); ok {
429 attrsMap[k] = v
430 }
431 }
432
433 a.pendingCacheProducts = products
434 a.pendingCacheRegions = regions
435 a.pendingCacheAttrs = attrsMap
436 a.pendingCachePrices = prices
437 a.pricingView.Loading = true
438 a.pricingView.ErrorMessage = ""
439
440 return a, fetchPricingCmd(a.client, products, regions, attrsMap, prices)
441}
442
443// View implements tea.Model.
444func (a App) View() string {

Callers 2

handlePricingEventMethod · 0.95
handleHistoryEventMethod · 0.95

Calls 1

fetchPricingCmdFunction · 0.85

Tested by

no test coverage detected