MCPcopy
hub / github.com/mlabouardy/komiser / StatsWithFilter

Method StatsWithFilter

controller/stats.go:35–57  ·  view source on GitHub ↗
(c context.Context, view models.View, arguments []int64, queryParameter string)

Source from the content-addressed store, hash-verified

33}
34
35func (ctrl *Controller) StatsWithFilter(c context.Context, view models.View, arguments []int64, queryParameter string) (regionCount totalOutput, resourceCount totalOutput, costCount costOutput, err error) {
36 queries, err := ctrl.repo.GenerateFilterQuery(view, repository.ListStatsWithFilter, arguments, queryParameter)
37 if err != nil {
38 return
39 }
40 _, err = ctrl.repo.HandleQuery(c, repository.ListStatsWithFilter, &regionCount, [][3]string{}, queries[0])
41 if err != nil {
42 return
43 }
44
45 // for resource count
46 _, err = ctrl.repo.HandleQuery(c, repository.ListStatsWithFilter, &resourceCount, [][3]string{}, queries[1])
47 if err != nil {
48 return
49 }
50
51 // for cost sum
52 _, err = ctrl.repo.HandleQuery(c, repository.ListStatsWithFilter, &costCount, [][3]string{}, queries[2])
53 if err != nil {
54 return
55 }
56 return
57}

Callers 1

FilterStatsHandlerMethod · 0.80

Calls 2

GenerateFilterQueryMethod · 0.65
HandleQueryMethod · 0.65

Tested by

no test coverage detected