Documentation ¶
Index ¶
- Constants
- Variables
- func NewAPITokenRepo(data *Data, logger log.Logger) biz.APITokenRepo
- func NewAttestationStateRepo(data *Data, logger log.Logger) biz.AttestationStateRepo
- func NewCASBackendRepo(data *Data, logger log.Logger) biz.CASBackendRepo
- func NewCASMappingRepo(data *Data, cbRepo biz.CASBackendRepo, logger log.Logger) biz.CASMappingRepo
- func NewIntegrationAttachmentRepo(data *Data, logger log.Logger) biz.IntegrationAttachmentRepo
- func NewIntegrationRepo(data *Data, logger log.Logger) biz.IntegrationRepo
- func NewMembershipRepo(data *Data, logger log.Logger) biz.MembershipRepo
- func NewOrgInvitation(data *Data, logger log.Logger) biz.OrgInvitationRepo
- func NewOrgMetricsRepo(data *Data, l log.Logger) biz.OrgMetricsRepo
- func NewOrganizationRepo(data *Data, logger log.Logger) biz.OrganizationRepo
- func NewProjectVersionRepo(data *Data, logger log.Logger) biz.ProjectVersionRepo
- func NewProjectsRepo(data *Data, logger log.Logger) biz.ProjectsRepo
- func NewReferrerRepo(data *Data, wfRepo biz.WorkflowRepo, logger log.Logger) biz.ReferrerRepo
- func NewRobotAccountRepo(data *Data, logger log.Logger) biz.RobotAccountRepo
- func NewUserRepo(data *Data, logger log.Logger) biz.UserRepo
- func NewWorkflowContractRepo(data *Data, logger log.Logger) biz.WorkflowContractRepo
- func NewWorkflowRepo(data *Data, logger log.Logger) biz.WorkflowRepo
- func NewWorkflowRunRepo(data *Data, logger log.Logger) biz.WorkflowRunRepo
- type APITokenRepo
- func (r *APITokenRepo) Create(ctx context.Context, name string, description *string, expiresAt *time.Time, ...) (*biz.APIToken, error)
- func (r *APITokenRepo) FindByID(ctx context.Context, id uuid.UUID) (*biz.APIToken, error)
- func (r *APITokenRepo) FindByNameInOrg(ctx context.Context, orgID uuid.UUID, name string) (*biz.APIToken, error)
- func (r *APITokenRepo) List(ctx context.Context, orgID *uuid.UUID, includeRevoked bool) ([]*biz.APIToken, error)
- func (r *APITokenRepo) Revoke(ctx context.Context, orgID, id uuid.UUID) error
- type AttestationStateRepo
- func (r *AttestationStateRepo) Initialized(ctx context.Context, runID uuid.UUID) (bool, error)
- func (r *AttestationStateRepo) Read(ctx context.Context, runID uuid.UUID) ([]byte, string, error)
- func (r *AttestationStateRepo) Reset(ctx context.Context, runID uuid.UUID) error
- func (r *AttestationStateRepo) Save(ctx context.Context, runID uuid.UUID, state []byte, baseDigest string) (err error)
- type CASBackendRepo
- func (r *CASBackendRepo) Create(ctx context.Context, opts *biz.CASBackendCreateOpts) (*biz.CASBackend, error)
- func (r *CASBackendRepo) Delete(ctx context.Context, id uuid.UUID) error
- func (r *CASBackendRepo) FindByID(ctx context.Context, id uuid.UUID) (*biz.CASBackend, error)
- func (r *CASBackendRepo) FindByIDInOrg(ctx context.Context, orgID, id uuid.UUID) (*biz.CASBackend, error)
- func (r *CASBackendRepo) FindByNameInOrg(ctx context.Context, orgID uuid.UUID, name string) (*biz.CASBackend, error)
- func (r *CASBackendRepo) FindDefaultBackend(ctx context.Context, orgID uuid.UUID) (*biz.CASBackend, error)
- func (r *CASBackendRepo) FindFallbackBackend(ctx context.Context, orgID uuid.UUID) (*biz.CASBackend, error)
- func (r *CASBackendRepo) List(ctx context.Context, orgID uuid.UUID) ([]*biz.CASBackend, error)
- func (r *CASBackendRepo) SoftDelete(ctx context.Context, id uuid.UUID) error
- func (r *CASBackendRepo) Update(ctx context.Context, opts *biz.CASBackendUpdateOpts) (*biz.CASBackend, error)
- func (r *CASBackendRepo) UpdateValidationStatus(ctx context.Context, id uuid.UUID, status biz.CASBackendValidationStatus) error
- type CASMappingRepo
- type Data
- type IntegrationAttachmentRepo
- func (r *IntegrationAttachmentRepo) Create(ctx context.Context, integrationID, workflowID uuid.UUID, config []byte) (*biz.IntegrationAttachment, error)
- func (r *IntegrationAttachmentRepo) FindByIDInOrg(ctx context.Context, orgID, id uuid.UUID) (*biz.IntegrationAttachment, error)
- func (r *IntegrationAttachmentRepo) List(ctx context.Context, orgID, workflowID uuid.UUID) ([]*biz.IntegrationAndAttachment, error)
- func (r *IntegrationAttachmentRepo) SoftDelete(ctx context.Context, id uuid.UUID) error
- type IntegrationRepo
- func (r *IntegrationRepo) Create(ctx context.Context, opts *biz.IntegrationCreateOpts) (*biz.Integration, error)
- func (r *IntegrationRepo) FindByIDInOrg(ctx context.Context, orgID, id uuid.UUID) (*biz.Integration, error)
- func (r *IntegrationRepo) FindByNameInOrg(ctx context.Context, orgID uuid.UUID, name string) (*biz.Integration, error)
- func (r *IntegrationRepo) List(ctx context.Context, orgID uuid.UUID) ([]*biz.Integration, error)
- func (r *IntegrationRepo) SoftDelete(ctx context.Context, id uuid.UUID) error
- type MembershipRepo
- func (r *MembershipRepo) Create(ctx context.Context, orgID, userID uuid.UUID, current bool, role authz.Role) (*biz.Membership, error)
- func (r *MembershipRepo) Delete(ctx context.Context, id uuid.UUID) error
- func (r *MembershipRepo) FindByIDInOrg(ctx context.Context, orgID, membershipID uuid.UUID) (*biz.Membership, error)
- func (r *MembershipRepo) FindByIDInUser(ctx context.Context, userID, membershipID uuid.UUID) (*biz.Membership, error)
- func (r *MembershipRepo) FindByOrg(ctx context.Context, orgID uuid.UUID) ([]*biz.Membership, error)
- func (r *MembershipRepo) FindByOrgAndUser(ctx context.Context, orgID, userID uuid.UUID) (*biz.Membership, error)
- func (r *MembershipRepo) FindByOrgNameAndUser(ctx context.Context, orgName string, userID uuid.UUID) (*biz.Membership, error)
- func (r *MembershipRepo) FindByUser(ctx context.Context, userID uuid.UUID) ([]*biz.Membership, error)
- func (r *MembershipRepo) SetCurrent(ctx context.Context, membershipID uuid.UUID) (*biz.Membership, error)
- func (r *MembershipRepo) SetRole(ctx context.Context, membershipID uuid.UUID, role authz.Role) (*biz.Membership, error)
- type NewConfig
- type OrgInvitation
- func (r *OrgInvitation) ChangeStatus(ctx context.Context, id uuid.UUID, status biz.OrgInvitationStatus) error
- func (r *OrgInvitation) Create(ctx context.Context, orgID, senderID uuid.UUID, receiverEmail string, ...) (*biz.OrgInvitation, error)
- func (r *OrgInvitation) FindByID(ctx context.Context, id uuid.UUID) (*biz.OrgInvitation, error)
- func (r *OrgInvitation) ListByOrg(ctx context.Context, orgID uuid.UUID) ([]*biz.OrgInvitation, error)
- func (r *OrgInvitation) PendingInvitation(ctx context.Context, orgID uuid.UUID, receiverEmail string) (*biz.OrgInvitation, error)
- func (r *OrgInvitation) PendingInvitations(ctx context.Context, receiverEmail string) ([]*biz.OrgInvitation, error)
- func (r *OrgInvitation) SoftDelete(ctx context.Context, id uuid.UUID) error
- type OrgMetricsRepo
- func (repo *OrgMetricsRepo) DailyRunsCount(ctx context.Context, orgID, workflowID uuid.UUID, tw *biz.TimeWindow) ([]*biz.DayRunsCount, error)
- func (repo *OrgMetricsRepo) RunsByRunnerTypeTotal(ctx context.Context, orgID uuid.UUID, tw *biz.TimeWindow) (map[string]int32, error)
- func (repo *OrgMetricsRepo) RunsByStatusTotal(ctx context.Context, orgID uuid.UUID, tw *biz.TimeWindow) (map[string]int32, error)
- func (repo *OrgMetricsRepo) RunsTotal(ctx context.Context, orgID uuid.UUID, tw *biz.TimeWindow) (int32, error)
- func (repo *OrgMetricsRepo) TopWorkflowsByRunsCount(ctx context.Context, orgID uuid.UUID, numWorkflows int, tw *biz.TimeWindow) ([]*biz.TopWorkflowsByRunsCountItem, error)
- type OrganizationRepo
- func (r *OrganizationRepo) Create(ctx context.Context, name string) (*biz.Organization, error)
- func (r *OrganizationRepo) Delete(ctx context.Context, id uuid.UUID) error
- func (r *OrganizationRepo) FindByID(ctx context.Context, id uuid.UUID) (*biz.Organization, error)
- func (r *OrganizationRepo) FindByName(ctx context.Context, name string) (*biz.Organization, error)
- type ProjectRepo
- func (r *ProjectRepo) Create(ctx context.Context, orgID uuid.UUID, name string) (*biz.Project, error)
- func (r *ProjectRepo) FindProjectByOrgIDAndID(ctx context.Context, orgID uuid.UUID, projectID uuid.UUID) (*biz.Project, error)
- func (r *ProjectRepo) FindProjectByOrgIDAndName(ctx context.Context, orgID uuid.UUID, projectName string) (*biz.Project, error)
- type ProjectVersionRepo
- func (r *ProjectVersionRepo) Create(ctx context.Context, projectID uuid.UUID, version string, prerelease bool) (*biz.ProjectVersion, error)
- func (r *ProjectVersionRepo) FindByProjectAndVersion(ctx context.Context, projectID uuid.UUID, version string) (*biz.ProjectVersion, error)
- func (r *ProjectVersionRepo) Update(ctx context.Context, id uuid.UUID, updates *biz.ProjectVersionUpdateOpts) (*biz.ProjectVersion, error)
- type ReferrerRepo
- func (r *ReferrerRepo) Exist(ctx context.Context, digest string, filters ...biz.GetFromRootFilter) (bool, error)
- func (r *ReferrerRepo) GetFromRoot(ctx context.Context, digest string, orgIDs []uuid.UUID, ...) (*biz.StoredReferrer, error)
- func (r *ReferrerRepo) Save(ctx context.Context, referrers []*biz.Referrer, workflowID uuid.UUID) error
- type RobotAccountRepo
- func (r *RobotAccountRepo) Create(ctx context.Context, name string, workflowID uuid.UUID) (*biz.RobotAccount, error)
- func (r *RobotAccountRepo) FindByID(ctx context.Context, id uuid.UUID) (*biz.RobotAccount, error)
- func (r *RobotAccountRepo) List(ctx context.Context, workflowID uuid.UUID, includeRevoked bool) ([]*biz.RobotAccount, error)
- func (r *RobotAccountRepo) Revoke(ctx context.Context, orgID, id uuid.UUID) error
- type WorkflowContractRepo
- func (r *WorkflowContractRepo) Create(ctx context.Context, opts *biz.ContractCreateOpts) (*biz.WorkflowContract, error)
- func (r *WorkflowContractRepo) Describe(ctx context.Context, orgID, contractID uuid.UUID, revision int) (*biz.WorkflowContractWithVersion, error)
- func (r *WorkflowContractRepo) FindByIDInOrg(ctx context.Context, orgID, contractID uuid.UUID) (*biz.WorkflowContract, error)
- func (r *WorkflowContractRepo) FindByNameInOrg(ctx context.Context, orgID uuid.UUID, name string) (*biz.WorkflowContract, error)
- func (r *WorkflowContractRepo) FindVersionByID(ctx context.Context, versionID uuid.UUID) (*biz.WorkflowContractWithVersion, error)
- func (r *WorkflowContractRepo) List(ctx context.Context, orgID uuid.UUID) ([]*biz.WorkflowContract, error)
- func (r *WorkflowContractRepo) SoftDelete(ctx context.Context, id uuid.UUID) error
- func (r *WorkflowContractRepo) Update(ctx context.Context, orgID uuid.UUID, name string, ...) (*biz.WorkflowContractWithVersion, error)
- type WorkflowRepo
- func (r *WorkflowRepo) Create(ctx context.Context, opts *biz.WorkflowCreateOpts) (wf *biz.Workflow, err error)
- func (r *WorkflowRepo) FindByID(ctx context.Context, id uuid.UUID) (*biz.Workflow, error)
- func (r *WorkflowRepo) GetOrgScoped(ctx context.Context, orgID, workflowID uuid.UUID) (*biz.Workflow, error)
- func (r *WorkflowRepo) GetOrgScopedByProjectAndName(ctx context.Context, orgID uuid.UUID, projectName, workflowName string) (*biz.Workflow, error)
- func (r *WorkflowRepo) IncRunsCounter(ctx context.Context, workflowID uuid.UUID) error
- func (r *WorkflowRepo) List(ctx context.Context, orgID uuid.UUID, filter *biz.WorkflowListOpts, ...) ([]*biz.Workflow, int, error)
- func (r *WorkflowRepo) SoftDelete(ctx context.Context, id uuid.UUID) error
- func (r *WorkflowRepo) Update(ctx context.Context, id uuid.UUID, opts *biz.WorkflowUpdateOpts) (*biz.Workflow, error)
- type WorkflowRunRepo
- func (r *WorkflowRunRepo) Create(ctx context.Context, opts *biz.WorkflowRunRepoCreateOpts) (run *biz.WorkflowRun, err error)
- func (r *WorkflowRunRepo) Expire(ctx context.Context, id uuid.UUID) error
- func (r *WorkflowRunRepo) FindByAttestationDigest(ctx context.Context, digest string) (*biz.WorkflowRun, error)
- func (r *WorkflowRunRepo) FindByID(ctx context.Context, id uuid.UUID) (*biz.WorkflowRun, error)
- func (r *WorkflowRunRepo) FindByIDInOrg(ctx context.Context, orgID, id uuid.UUID) (*biz.WorkflowRun, error)
- func (r *WorkflowRunRepo) List(ctx context.Context, orgID uuid.UUID, filters *biz.RunListFilters, ...) (result []*biz.WorkflowRun, cursor string, err error)
- func (r *WorkflowRunRepo) ListNotFinishedOlderThan(ctx context.Context, olderThan time.Time) ([]*biz.WorkflowRun, error)
- func (r *WorkflowRunRepo) MarkAsFinished(ctx context.Context, id uuid.UUID, status biz.WorkflowRunStatus, reason string) error
- func (r *WorkflowRunRepo) SaveAttestation(ctx context.Context, id uuid.UUID, att *dsse.Envelope, digest string) error
Constants ¶
const ( DefaultMaxIdleConns = 10 DefaultMaxOpenConns = 50 DefaultMaxIdleTime = 5 * time.Minute )
Variables ¶
var ProviderSet = wire.NewSet( NewData, NewWorkflowRepo, NewUserRepo, NewRobotAccountRepo, NewWorkflowRunRepo, NewOrganizationRepo, NewWorkflowContractRepo, NewCASBackendRepo, NewOrgMetricsRepo, NewIntegrationRepo, NewIntegrationAttachmentRepo, NewCASMappingRepo, NewMembershipRepo, NewOrgInvitation, NewReferrerRepo, NewAPITokenRepo, NewAttestationStateRepo, NewProjectVersionRepo, NewProjectsRepo, )
ProviderSet is data providers.
Functions ¶
func NewAPITokenRepo ¶
func NewAPITokenRepo(data *Data, logger log.Logger) biz.APITokenRepo
func NewAttestationStateRepo ¶
func NewAttestationStateRepo(data *Data, logger log.Logger) biz.AttestationStateRepo
func NewCASBackendRepo ¶
func NewCASBackendRepo(data *Data, logger log.Logger) biz.CASBackendRepo
func NewCASMappingRepo ¶
func NewCASMappingRepo(data *Data, cbRepo biz.CASBackendRepo, logger log.Logger) biz.CASMappingRepo
func NewIntegrationAttachmentRepo ¶
func NewIntegrationAttachmentRepo(data *Data, logger log.Logger) biz.IntegrationAttachmentRepo
func NewIntegrationRepo ¶
func NewIntegrationRepo(data *Data, logger log.Logger) biz.IntegrationRepo
func NewMembershipRepo ¶
func NewMembershipRepo(data *Data, logger log.Logger) biz.MembershipRepo
func NewOrgInvitation ¶
func NewOrgInvitation(data *Data, logger log.Logger) biz.OrgInvitationRepo
func NewOrgMetricsRepo ¶
func NewOrgMetricsRepo(data *Data, l log.Logger) biz.OrgMetricsRepo
func NewOrganizationRepo ¶
func NewOrganizationRepo(data *Data, logger log.Logger) biz.OrganizationRepo
func NewProjectVersionRepo ¶ added in v0.97.5
func NewProjectVersionRepo(data *Data, logger log.Logger) biz.ProjectVersionRepo
func NewProjectsRepo ¶ added in v0.97.5
func NewProjectsRepo(data *Data, logger log.Logger) biz.ProjectsRepo
func NewReferrerRepo ¶
func NewReferrerRepo(data *Data, wfRepo biz.WorkflowRepo, logger log.Logger) biz.ReferrerRepo
func NewRobotAccountRepo ¶
func NewRobotAccountRepo(data *Data, logger log.Logger) biz.RobotAccountRepo
func NewWorkflowContractRepo ¶
func NewWorkflowContractRepo(data *Data, logger log.Logger) biz.WorkflowContractRepo
func NewWorkflowRepo ¶
func NewWorkflowRepo(data *Data, logger log.Logger) biz.WorkflowRepo
func NewWorkflowRunRepo ¶
func NewWorkflowRunRepo(data *Data, logger log.Logger) biz.WorkflowRunRepo
Types ¶
type APITokenRepo ¶
type APITokenRepo struct {
// contains filtered or unexported fields
}
func (*APITokenRepo) Create ¶
func (r *APITokenRepo) Create(ctx context.Context, name string, description *string, expiresAt *time.Time, organizationID uuid.UUID) (*biz.APIToken, error)
Persist the APIToken to the database.
func (*APITokenRepo) FindByNameInOrg ¶ added in v0.93.1
type AttestationStateRepo ¶
type AttestationStateRepo struct {
// contains filtered or unexported fields
}
func (*AttestationStateRepo) Initialized ¶
find the workflow run by its ID and check that it has attestation state
func (*AttestationStateRepo) Save ¶
func (r *AttestationStateRepo) Save(ctx context.Context, runID uuid.UUID, state []byte, baseDigest string) (err error)
baseDigest, when provided will be used to check that it matches the digest of the state currently in the DB if the digests do not match, the state has been modified and the caller should retry
type CASBackendRepo ¶
type CASBackendRepo struct {
// contains filtered or unexported fields
}
func (*CASBackendRepo) Create ¶
func (r *CASBackendRepo) Create(ctx context.Context, opts *biz.CASBackendCreateOpts) (*biz.CASBackend, error)
Create creates a new CAS backend in the given organization If it's set as default, it will unset the previous default backend
func (*CASBackendRepo) FindByID ¶
func (r *CASBackendRepo) FindByID(ctx context.Context, id uuid.UUID) (*biz.CASBackend, error)
FindByID finds a CAS backend by ID If not found, returns nil and no error
func (*CASBackendRepo) FindByIDInOrg ¶
func (r *CASBackendRepo) FindByIDInOrg(ctx context.Context, orgID, id uuid.UUID) (*biz.CASBackend, error)
FindByIDInOrg finds a CAS backend by ID in the given organization. If not found, returns nil and no error
func (*CASBackendRepo) FindByNameInOrg ¶ added in v0.93.0
func (r *CASBackendRepo) FindByNameInOrg(ctx context.Context, orgID uuid.UUID, name string) (*biz.CASBackend, error)
func (*CASBackendRepo) FindDefaultBackend ¶
func (r *CASBackendRepo) FindDefaultBackend(ctx context.Context, orgID uuid.UUID) (*biz.CASBackend, error)
FindDefaultBackend finds the CAS backend that's set as default for the given organization
func (*CASBackendRepo) FindFallbackBackend ¶
func (r *CASBackendRepo) FindFallbackBackend(ctx context.Context, orgID uuid.UUID) (*biz.CASBackend, error)
FindFallbackBackend finds the CAS backend that's set as fallback for the given organization
func (*CASBackendRepo) List ¶
func (r *CASBackendRepo) List(ctx context.Context, orgID uuid.UUID) ([]*biz.CASBackend, error)
func (*CASBackendRepo) SoftDelete ¶
Set deleted at instead of actually deleting the backend
func (*CASBackendRepo) Update ¶
func (r *CASBackendRepo) Update(ctx context.Context, opts *biz.CASBackendUpdateOpts) (*biz.CASBackend, error)
func (*CASBackendRepo) UpdateValidationStatus ¶
func (r *CASBackendRepo) UpdateValidationStatus(ctx context.Context, id uuid.UUID, status biz.CASBackendValidationStatus) error
UpdateValidationStatus updates the validation status of an OCI repository
type CASMappingRepo ¶
type CASMappingRepo struct {
// contains filtered or unexported fields
}
func (*CASMappingRepo) Create ¶
func (r *CASMappingRepo) Create(ctx context.Context, digest string, casBackendID, workflowRunID uuid.UUID) (*biz.CASMapping, error)
func (*CASMappingRepo) FindByDigest ¶
func (r *CASMappingRepo) FindByDigest(ctx context.Context, digest string) ([]*biz.CASMapping, error)
type Data ¶
Data .
func (*Data) SchemaLoad ¶
Load DB schema NOTE: this is different than running migrations this method is used to load the schema into the DB for TESTING!
type IntegrationAttachmentRepo ¶
type IntegrationAttachmentRepo struct {
// contains filtered or unexported fields
}
func (*IntegrationAttachmentRepo) Create ¶
func (r *IntegrationAttachmentRepo) Create(ctx context.Context, integrationID, workflowID uuid.UUID, config []byte) (*biz.IntegrationAttachment, error)
func (*IntegrationAttachmentRepo) FindByIDInOrg ¶
func (r *IntegrationAttachmentRepo) FindByIDInOrg(ctx context.Context, orgID, id uuid.UUID) (*biz.IntegrationAttachment, error)
func (*IntegrationAttachmentRepo) List ¶
func (r *IntegrationAttachmentRepo) List(ctx context.Context, orgID, workflowID uuid.UUID) ([]*biz.IntegrationAndAttachment, error)
func (*IntegrationAttachmentRepo) SoftDelete ¶
type IntegrationRepo ¶
type IntegrationRepo struct {
// contains filtered or unexported fields
}
func (*IntegrationRepo) Create ¶
func (r *IntegrationRepo) Create(ctx context.Context, opts *biz.IntegrationCreateOpts) (*biz.Integration, error)
func (*IntegrationRepo) FindByIDInOrg ¶
func (r *IntegrationRepo) FindByIDInOrg(ctx context.Context, orgID, id uuid.UUID) (*biz.Integration, error)
func (*IntegrationRepo) FindByNameInOrg ¶ added in v0.93.0
func (r *IntegrationRepo) FindByNameInOrg(ctx context.Context, orgID uuid.UUID, name string) (*biz.Integration, error)
func (*IntegrationRepo) List ¶
func (r *IntegrationRepo) List(ctx context.Context, orgID uuid.UUID) ([]*biz.Integration, error)
func (*IntegrationRepo) SoftDelete ¶
type MembershipRepo ¶
type MembershipRepo struct {
// contains filtered or unexported fields
}
func (*MembershipRepo) FindByIDInOrg ¶
func (r *MembershipRepo) FindByIDInOrg(ctx context.Context, orgID, membershipID uuid.UUID) (*biz.Membership, error)
func (*MembershipRepo) FindByIDInUser ¶
func (r *MembershipRepo) FindByIDInUser(ctx context.Context, userID, membershipID uuid.UUID) (*biz.Membership, error)
func (*MembershipRepo) FindByOrg ¶
func (r *MembershipRepo) FindByOrg(ctx context.Context, orgID uuid.UUID) ([]*biz.Membership, error)
FindByOrg finds all memberships for a given organization
func (*MembershipRepo) FindByOrgAndUser ¶
func (r *MembershipRepo) FindByOrgAndUser(ctx context.Context, orgID, userID uuid.UUID) (*biz.Membership, error)
FindByOrgAndUser finds the membership for a given organization and user
func (*MembershipRepo) FindByOrgNameAndUser ¶ added in v0.109.0
func (r *MembershipRepo) FindByOrgNameAndUser(ctx context.Context, orgName string, userID uuid.UUID) (*biz.Membership, error)
func (*MembershipRepo) FindByUser ¶
func (r *MembershipRepo) FindByUser(ctx context.Context, userID uuid.UUID) ([]*biz.Membership, error)
func (*MembershipRepo) SetCurrent ¶
func (r *MembershipRepo) SetCurrent(ctx context.Context, membershipID uuid.UUID) (*biz.Membership, error)
type OrgInvitation ¶
type OrgInvitation struct {
// contains filtered or unexported fields
}
func (*OrgInvitation) ChangeStatus ¶
func (r *OrgInvitation) ChangeStatus(ctx context.Context, id uuid.UUID, status biz.OrgInvitationStatus) error
func (*OrgInvitation) FindByID ¶
func (r *OrgInvitation) FindByID(ctx context.Context, id uuid.UUID) (*biz.OrgInvitation, error)
func (*OrgInvitation) ListByOrg ¶
func (r *OrgInvitation) ListByOrg(ctx context.Context, orgID uuid.UUID) ([]*biz.OrgInvitation, error)
func (*OrgInvitation) PendingInvitation ¶
func (r *OrgInvitation) PendingInvitation(ctx context.Context, orgID uuid.UUID, receiverEmail string) (*biz.OrgInvitation, error)
func (*OrgInvitation) PendingInvitations ¶
func (r *OrgInvitation) PendingInvitations(ctx context.Context, receiverEmail string) ([]*biz.OrgInvitation, error)
func (*OrgInvitation) SoftDelete ¶
type OrgMetricsRepo ¶
type OrgMetricsRepo struct {
// contains filtered or unexported fields
}
func (*OrgMetricsRepo) DailyRunsCount ¶
func (repo *OrgMetricsRepo) DailyRunsCount(ctx context.Context, orgID, workflowID uuid.UUID, tw *biz.TimeWindow) ([]*biz.DayRunsCount, error)
func (*OrgMetricsRepo) RunsByRunnerTypeTotal ¶
func (repo *OrgMetricsRepo) RunsByRunnerTypeTotal(ctx context.Context, orgID uuid.UUID, tw *biz.TimeWindow) (map[string]int32, error)
func (*OrgMetricsRepo) RunsByStatusTotal ¶
func (repo *OrgMetricsRepo) RunsByStatusTotal(ctx context.Context, orgID uuid.UUID, tw *biz.TimeWindow) (map[string]int32, error)
func (*OrgMetricsRepo) RunsTotal ¶
func (repo *OrgMetricsRepo) RunsTotal(ctx context.Context, orgID uuid.UUID, tw *biz.TimeWindow) (int32, error)
func (*OrgMetricsRepo) TopWorkflowsByRunsCount ¶
func (repo *OrgMetricsRepo) TopWorkflowsByRunsCount(ctx context.Context, orgID uuid.UUID, numWorkflows int, tw *biz.TimeWindow) ([]*biz.TopWorkflowsByRunsCountItem, error)
type OrganizationRepo ¶
type OrganizationRepo struct {
// contains filtered or unexported fields
}
func (*OrganizationRepo) Create ¶
func (r *OrganizationRepo) Create(ctx context.Context, name string) (*biz.Organization, error)
func (*OrganizationRepo) FindByID ¶
func (r *OrganizationRepo) FindByID(ctx context.Context, id uuid.UUID) (*biz.Organization, error)
func (*OrganizationRepo) FindByName ¶ added in v0.91.8
func (r *OrganizationRepo) FindByName(ctx context.Context, name string) (*biz.Organization, error)
FindByName finds an organization by name.
type ProjectRepo ¶ added in v0.97.5
type ProjectRepo struct {
// contains filtered or unexported fields
}
type ProjectVersionRepo ¶ added in v0.97.5
type ProjectVersionRepo struct {
// contains filtered or unexported fields
}
func (*ProjectVersionRepo) Create ¶ added in v0.98.0
func (r *ProjectVersionRepo) Create(ctx context.Context, projectID uuid.UUID, version string, prerelease bool) (*biz.ProjectVersion, error)
func (*ProjectVersionRepo) FindByProjectAndVersion ¶ added in v0.97.5
func (r *ProjectVersionRepo) FindByProjectAndVersion(ctx context.Context, projectID uuid.UUID, version string) (*biz.ProjectVersion, error)
func (*ProjectVersionRepo) Update ¶ added in v0.98.0
func (r *ProjectVersionRepo) Update(ctx context.Context, id uuid.UUID, updates *biz.ProjectVersionUpdateOpts) (*biz.ProjectVersion, error)
type ReferrerRepo ¶
type ReferrerRepo struct {
// contains filtered or unexported fields
}
func (*ReferrerRepo) Exist ¶
func (r *ReferrerRepo) Exist(ctx context.Context, digest string, filters ...biz.GetFromRootFilter) (bool, error)
Check if a given referrer by digest exist. The query can be scoped further down if needed by providing the kind or visibility status
func (*ReferrerRepo) GetFromRoot ¶
func (r *ReferrerRepo) GetFromRoot(ctx context.Context, digest string, orgIDs []uuid.UUID, filters ...biz.GetFromRootFilter) (*biz.StoredReferrer, error)
type RobotAccountRepo ¶
type RobotAccountRepo struct {
// contains filtered or unexported fields
}
func (*RobotAccountRepo) Create ¶
func (r *RobotAccountRepo) Create(ctx context.Context, name string, workflowID uuid.UUID) (*biz.RobotAccount, error)
func (*RobotAccountRepo) FindByID ¶
func (r *RobotAccountRepo) FindByID(ctx context.Context, id uuid.UUID) (*biz.RobotAccount, error)
type WorkflowContractRepo ¶
type WorkflowContractRepo struct {
// contains filtered or unexported fields
}
func (*WorkflowContractRepo) Create ¶
func (r *WorkflowContractRepo) Create(ctx context.Context, opts *biz.ContractCreateOpts) (*biz.WorkflowContract, error)
func (*WorkflowContractRepo) Describe ¶
func (r *WorkflowContractRepo) Describe(ctx context.Context, orgID, contractID uuid.UUID, revision int) (*biz.WorkflowContractWithVersion, error)
func (*WorkflowContractRepo) FindByIDInOrg ¶
func (r *WorkflowContractRepo) FindByIDInOrg(ctx context.Context, orgID, contractID uuid.UUID) (*biz.WorkflowContract, error)
func (*WorkflowContractRepo) FindByNameInOrg ¶ added in v0.93.0
func (r *WorkflowContractRepo) FindByNameInOrg(ctx context.Context, orgID uuid.UUID, name string) (*biz.WorkflowContract, error)
func (*WorkflowContractRepo) FindVersionByID ¶
func (r *WorkflowContractRepo) FindVersionByID(ctx context.Context, versionID uuid.UUID) (*biz.WorkflowContractWithVersion, error)
func (*WorkflowContractRepo) List ¶
func (r *WorkflowContractRepo) List(ctx context.Context, orgID uuid.UUID) ([]*biz.WorkflowContract, error)
func (*WorkflowContractRepo) SoftDelete ¶
func (*WorkflowContractRepo) Update ¶
func (r *WorkflowContractRepo) Update(ctx context.Context, orgID uuid.UUID, name string, opts *biz.ContractUpdateOpts) (*biz.WorkflowContractWithVersion, error)
Update will add a new version of the contract. NOTE: ContractVersions are immutable
type WorkflowRepo ¶
type WorkflowRepo struct {
// contains filtered or unexported fields
}
func (*WorkflowRepo) Create ¶
func (r *WorkflowRepo) Create(ctx context.Context, opts *biz.WorkflowCreateOpts) (wf *biz.Workflow, err error)
func (*WorkflowRepo) GetOrgScoped ¶
func (r *WorkflowRepo) GetOrgScoped(ctx context.Context, orgID, workflowID uuid.UUID) (*biz.Workflow, error)
GetOrgScoped Gets a workflow making sure it belongs to a given org
func (*WorkflowRepo) GetOrgScopedByProjectAndName ¶ added in v0.96.15
func (r *WorkflowRepo) GetOrgScopedByProjectAndName(ctx context.Context, orgID uuid.UUID, projectName, workflowName string) (*biz.Workflow, error)
GetOrgScopedByProjectAndName Gets a workflow by name making sure it belongs to a given org
func (*WorkflowRepo) IncRunsCounter ¶
func (*WorkflowRepo) List ¶
func (r *WorkflowRepo) List(ctx context.Context, orgID uuid.UUID, filter *biz.WorkflowListOpts, pagination *pagination.OffsetPaginationOpts) ([]*biz.Workflow, int, error)
func (*WorkflowRepo) SoftDelete ¶
Soft delete workflow, attachments and related projects (if applicable)
type WorkflowRunRepo ¶
type WorkflowRunRepo struct {
// contains filtered or unexported fields
}
func (*WorkflowRunRepo) Create ¶
func (r *WorkflowRunRepo) Create(ctx context.Context, opts *biz.WorkflowRunRepoCreateOpts) (run *biz.WorkflowRun, err error)
func (*WorkflowRunRepo) FindByAttestationDigest ¶
func (r *WorkflowRunRepo) FindByAttestationDigest(ctx context.Context, digest string) (*biz.WorkflowRun, error)
func (*WorkflowRunRepo) FindByID ¶
func (r *WorkflowRunRepo) FindByID(ctx context.Context, id uuid.UUID) (*biz.WorkflowRun, error)
func (*WorkflowRunRepo) FindByIDInOrg ¶
func (r *WorkflowRunRepo) FindByIDInOrg(ctx context.Context, orgID, id uuid.UUID) (*biz.WorkflowRun, error)
func (*WorkflowRunRepo) List ¶
func (r *WorkflowRunRepo) List(ctx context.Context, orgID uuid.UUID, filters *biz.RunListFilters, p *pagination.CursorOptions) (result []*biz.WorkflowRun, cursor string, err error)
List the runs in an organization, optionally filtered out by workflow
func (*WorkflowRunRepo) ListNotFinishedOlderThan ¶
func (r *WorkflowRunRepo) ListNotFinishedOlderThan(ctx context.Context, olderThan time.Time) ([]*biz.WorkflowRun, error)
func (*WorkflowRunRepo) MarkAsFinished ¶
func (r *WorkflowRunRepo) MarkAsFinished(ctx context.Context, id uuid.UUID, status biz.WorkflowRunStatus, reason string) error