MCPcopy Create free account
hub / github.com/monitoror/monitoror / Count

Method Count

monitorables/github/api/usecase/github.go:51–64  ·  view source on GitHub ↗
(params *models.CountParams)

Source from the content-addressed store, hash-verified

49}
50
51func (gu *githubUsecase) Count(params *models.CountParams) (*coreModels.Tile, error) {
52 tile := coreModels.NewTile(api.GithubCountTileType).WithValue(coreModels.NumberUnit)
53 tile.Label = "GitHub count"
54
55 count, err := gu.repository.GetCount(params.Query)
56 if err != nil {
57 return nil, &coreModels.MonitororError{Err: err, Tile: tile, Message: "unable to load count or wrong query"}
58 }
59
60 tile.Status = coreModels.SuccessStatus
61 tile.Value.Values = append(tile.Value.Values, fmt.Sprintf("%d", count))
62
63 return tile, nil
64}
65
66func (gu *githubUsecase) Checks(params *models.ChecksParams) (*coreModels.Tile, error) {
67 tile := coreModels.NewTile(api.GithubChecksTileType).WithBuild()

Callers

nothing calls this directly

Calls 2

WithValueMethod · 0.80
GetCountMethod · 0.65

Tested by

no test coverage detected