MCPcopy Create free account
hub / github.com/chainloop-dev/chainloop / List

Method List

app/controlplane/pkg/data/robotaccount.go:57–77  ·  view source on GitHub ↗
(ctx context.Context, workflowID uuid.UUID, includeRevoked bool)

Source from the content-addressed store, hash-verified

55}
56
57func (r *RobotAccountRepo) List(ctx context.Context, workflowID uuid.UUID, includeRevoked bool) ([]*biz.RobotAccount, error) {
58 ctx, span := otelx.Start(ctx, robotAccountRepoTracer, "RobotAccountRepo.List")
59 defer span.End()
60
61 raQuery := r.data.DB.Workflow.Query().Where(workflow.ID(workflowID)).QueryRobotaccounts()
62 if !includeRevoked {
63 raQuery = raQuery.Where(robotaccount.RevokedAtIsNil())
64 }
65
66 robotAccounts, err := raQuery.All(ctx)
67 if err != nil {
68 return nil, err
69 }
70
71 result := make([]*biz.RobotAccount, 0, len(robotAccounts))
72 for _, a := range robotAccounts {
73 result = append(result, entRaToBizRa(a, workflowID))
74 }
75
76 return result, nil
77}
78
79func (r *RobotAccountRepo) FindByID(ctx context.Context, id uuid.UUID) (*biz.RobotAccount, error) {
80 ctx, span := otelx.Start(ctx, robotAccountRepoTracer, "RobotAccountRepo.FindByID")

Callers

nothing calls this directly

Implementers 6

RobotAccountUseCaseapp/controlplane/pkg/biz/robotaccount.
APITokenUseCaseapp/controlplane/pkg/biz/apitoken.go
APITokenRepoapp/controlplane/pkg/biz/mocks/APIToke
APITokenRepo_Expecterapp/controlplane/pkg/biz/mocks/APIToke
RobotAccountRepoapp/controlplane/pkg/data/robotaccount
APITokenRepoapp/controlplane/pkg/data/apitoken.go

Calls 8

StartFunction · 0.92
IDFunction · 0.92
RevokedAtIsNilFunction · 0.92
entRaToBizRaFunction · 0.85
QueryRobotaccountsMethod · 0.45
WhereMethod · 0.45
QueryMethod · 0.45
AllMethod · 0.45

Tested by

no test coverage detected