(kind string)
| 11 | func NewEntityService() *EntityService { return &EntityService{} } |
| 12 | |
| 13 | func (s *EntityService) List(kind string) ([]EntityDTO, error) { |
| 14 | store, err := entityStore(kind) |
| 15 | if err != nil { |
| 16 | return nil, err |
| 17 | } |
| 18 | all, err := store.All() |
| 19 | if err != nil { |
| 20 | return nil, wrapError("ENTITY_LIST_FAILED", err) |
| 21 | } |
| 22 | out := make([]EntityDTO, 0, len(all)) |
| 23 | for _, entity := range all { |
| 24 | out = append(out, entityDTO(entity)) |
| 25 | } |
| 26 | return out, nil |
| 27 | } |
| 28 | |
| 29 | func (s *EntityService) Search(kind, query string) ([]EntityDTO, error) { |
| 30 | all, err := s.List(kind) |
no test coverage detected