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

Method List

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

List returns all hosts.

(ctx context.Context)

Source from the content-addressed store, hash-verified

24
25// List returns all hosts.
26func (s *HostsStore) List(ctx context.Context) ([]models.Host, error) {
27 d := s.db.DB(ctx)
28 rows, err := d.Queries.ListHosts(ctx)
29 if err != nil {
30 return nil, err
31 }
32 out := make([]models.Host, len(rows))
33 for i, h := range rows {
34 out[i] = *dbHostToModel(h)
35 }
36 return out, nil
37}
38
39// ListPaginated returns hosts with pagination.
40func (s *HostsStore) ListPaginated(ctx context.Context, limit, offset int) ([]models.Host, error) {

Callers 1

ListForScopedApiMethod · 0.95

Calls 3

dbHostToModelFunction · 0.85
DBMethod · 0.65
ListHostsMethod · 0.65

Tested by

no test coverage detected