List returns all host groups.
(ctx context.Context)
| 23 | |
| 24 | // List returns all host groups. |
| 25 | func (s *HostGroupsStore) List(ctx context.Context) ([]models.HostGroup, error) { |
| 26 | d := s.db.DB(ctx) |
| 27 | rows, err := d.Queries.ListHostGroups(ctx) |
| 28 | if err != nil { |
| 29 | return nil, err |
| 30 | } |
| 31 | out := make([]models.HostGroup, len(rows)) |
| 32 | for i := range rows { |
| 33 | out[i] = dbHostGroupToModelFull(rows[i]) |
| 34 | } |
| 35 | return out, nil |
| 36 | } |
| 37 | |
| 38 | // ListWithHostCount returns all host groups with host count (for settings UI). |
| 39 | func (s *HostGroupsStore) ListWithHostCount(ctx context.Context) ([]db.ListHostGroupsWithHostCountRow, error) { |
nothing calls this directly
no test coverage detected