MCPcopy Index your code
hub / github.com/PatchMon/PatchMon / GetHostGroups

Method GetHostGroups

server-source-code/internal/store/hosts.go:318–324  ·  view source on GitHub ↗

GetHostGroups returns host groups for a host.

(ctx context.Context, hostID string)

Source from the content-addressed store, hash-verified

316
317// GetHostGroups returns host groups for a host.
318func (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.
327func (s *HostsStore) GetHostGroupsForHosts(ctx context.Context, hostIDs []string) (map[string][]models.HostGroup, error) {

Callers 9

GetHostDetailMethod · 0.95
GetHostInfoMethod · 0.80
GetByIDMethod · 0.80
CreateMethod · 0.80
UpdateGroupsMethod · 0.80
UpdateFriendlyNameMethod · 0.80
UpdateNotesMethod · 0.80
UpdateConnectionMethod · 0.80
SetPrimaryInterfaceMethod · 0.80

Calls 1

GetHostGroupsForHostsMethod · 0.95

Tested by

no test coverage detected