MCPcopy Create free account
hub / github.com/PatchMon/PatchMon / List

Method List

server-source-code/internal/store/host_groups.go:25–36  ·  view source on GitHub ↗

List returns all host groups.

(ctx context.Context)

Source from the content-addressed store, hash-verified

23
24// List returns all host groups.
25func (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).
39func (s *HostGroupsStore) ListWithHostCount(ctx context.Context) ([]db.ListHostGroupsWithHostCountRow, error) {

Callers

nothing calls this directly

Calls 3

dbHostGroupToModelFullFunction · 0.85
DBMethod · 0.65
ListHostGroupsMethod · 0.65

Tested by

no test coverage detected