(ctx context.Context, orgID uuid.UUID)
| 44 | } |
| 45 | |
| 46 | func (r *CASBackendRepo) List(ctx context.Context, orgID uuid.UUID) ([]*biz.CASBackend, error) { |
| 47 | ctx, span := otelx.Start(ctx, casBackendRepoTracer, "CASBackendRepo.List") |
| 48 | defer span.End() |
| 49 | |
| 50 | backends, err := orgScopedQuery(r.data.DB, orgID).QueryCasBackends(). |
| 51 | Where(casbackend.DeletedAtIsNil()). |
| 52 | Order(ent.Desc(casbackend.FieldCreatedAt)). |
| 53 | All(ctx) |
| 54 | if err != nil { |
| 55 | return nil, fmt.Errorf("failed to list cas backends: %w", err) |
| 56 | } |
| 57 | |
| 58 | res := make([]*biz.CASBackend, 0, len(backends)) |
| 59 | for _, backend := range backends { |
| 60 | res = append(res, entCASBackendToBiz(backend)) |
| 61 | } |
| 62 | |
| 63 | return res, nil |
| 64 | } |
| 65 | |
| 66 | // FindDefaultBackend finds the CAS backend that's set as default for the given organization |
| 67 | func (r *CASBackendRepo) FindDefaultBackend(ctx context.Context, orgID uuid.UUID) (*biz.CASBackend, error) { |
nothing calls this directly
no test coverage detected