| 49 | } |
| 50 | |
| 51 | func (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 | |
| 66 | func (gu *githubUsecase) Checks(params *models.ChecksParams) (*coreModels.Tile, error) { |
| 67 | tile := coreModels.NewTile(api.GithubChecksTileType).WithBuild() |