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

Method List

server-source-code/internal/store/users.go:175–186  ·  view source on GitHub ↗

List returns all users (for admin).

(ctx context.Context, limit, offset int)

Source from the content-addressed store, hash-verified

173
174// List returns all users (for admin).
175func (s *UsersStore) List(ctx context.Context, limit, offset int) ([]models.User, error) {
176 d := s.db.DB(ctx)
177 rows, err := d.Queries.ListUsers(ctx, db.ListUsersParams{Limit: safeconv.ClampToInt32(limit), Offset: safeconv.ClampToInt32(offset)})
178 if err != nil {
179 return nil, err
180 }
181 out := make([]models.User, len(rows))
182 for i := range rows {
183 out[i] = dbUserToModel(rows[i])
184 }
185 return out, nil
186}
187
188// Count returns total user count.
189func (s *UsersStore) Count(ctx context.Context) (int, error) {

Callers

nothing calls this directly

Calls 3

dbUserToModelFunction · 0.85
DBMethod · 0.65
ListUsersMethod · 0.65

Tested by

no test coverage detected