GetHostGroups returns host groups for a host.
(ctx context.Context, hostID string)
| 316 | |
| 317 | // GetHostGroups returns host groups for a host. |
| 318 | func (s *HostsStore) GetHostGroups(ctx context.Context, hostID string) ([]models.HostGroup, error) { |
| 319 | groups, err := s.GetHostGroupsForHosts(ctx, []string{hostID}) |
| 320 | if err != nil { |
| 321 | return nil, err |
| 322 | } |
| 323 | return groups[hostID], nil |
| 324 | } |
| 325 | |
| 326 | // GetHostGroupsForHosts returns host groups for multiple hosts in one query. |
| 327 | func (s *HostsStore) GetHostGroupsForHosts(ctx context.Context, hostIDs []string) (map[string][]models.HostGroup, error) { |
no test coverage detected