MCPcopy Index your code
hub / github.com/chainloop-dev/chainloop / List

Method List

app/controlplane/pkg/data/casbackend.go:46–64  ·  view source on GitHub ↗
(ctx context.Context, orgID uuid.UUID)

Source from the content-addressed store, hash-verified

44}
45
46func (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
67func (r *CASBackendRepo) FindDefaultBackend(ctx context.Context, orgID uuid.UUID) (*biz.CASBackend, error) {

Callers

nothing calls this directly

Implementers 3

CASBackendRepoapp/controlplane/pkg/biz/mocks/CASBack
CASBackendRepo_Expecterapp/controlplane/pkg/biz/mocks/CASBack
CASBackendRepoapp/controlplane/pkg/data/casbackend.g

Calls 9

StartFunction · 0.92
DeletedAtIsNilFunction · 0.92
DescFunction · 0.92
orgScopedQueryFunction · 0.85
entCASBackendToBizFunction · 0.85
AllMethod · 0.45
OrderMethod · 0.45
WhereMethod · 0.45
QueryCasBackendsMethod · 0.45

Tested by

no test coverage detected