List returns all hosts.
(ctx context.Context)
| 24 | |
| 25 | // List returns all hosts. |
| 26 | func (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. |
| 40 | func (s *HostsStore) ListPaginated(ctx context.Context, limit, offset int) ([]models.Host, error) { |
no test coverage detected