Help us shape the future of Go! Take the 2026 Go Developer Survey

data

package
v0.17.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 5, 2023 License: Apache-2.0 Imports: 32 Imported by: 0

README

Data

Documentation

Index

Constants

This section is empty.

Variables

ProviderSet is data providers.

Functions

func NewCASBackendRepo added in v0.14.0

func NewCASBackendRepo(data *Data, logger log.Logger) biz.CASBackendRepo

func NewCASMappingRepo added in v0.17.0

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 NewOrgMetricsRepo

func NewOrgMetricsRepo(data *Data, l log.Logger) biz.OrgMetricsRepo

func NewOrganizationRepo

func NewOrganizationRepo(data *Data, logger log.Logger) biz.OrganizationRepo

func NewRobotAccountRepo

func NewRobotAccountRepo(data *Data, logger log.Logger) biz.RobotAccountRepo

func NewUserRepo

func NewUserRepo(data *Data, logger log.Logger) biz.UserRepo

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 CASBackendRepo added in v0.14.0

type CASBackendRepo struct {
	// contains filtered or unexported fields
}

func (*CASBackendRepo) Create added in v0.14.0

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) Delete added in v0.14.0

func (r *CASBackendRepo) Delete(ctx context.Context, id uuid.UUID) error

Delete deletes a CAS backend from the DB

func (*CASBackendRepo) FindByID added in v0.14.0

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 added in v0.14.0

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) FindDefaultBackend added in v0.14.0

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 added in v0.14.0

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 added in v0.14.0

func (r *CASBackendRepo) List(ctx context.Context, orgID uuid.UUID) ([]*biz.CASBackend, error)

func (*CASBackendRepo) SoftDelete added in v0.14.0

func (r *CASBackendRepo) SoftDelete(ctx context.Context, id uuid.UUID) error

Set deleted at instead of actually deleting the backend

func (*CASBackendRepo) Update added in v0.14.0

func (*CASBackendRepo) UpdateValidationStatus added in v0.14.0

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 added in v0.17.0

type CASMappingRepo struct {
	// contains filtered or unexported fields
}

func (*CASMappingRepo) Create added in v0.17.0

func (r *CASMappingRepo) Create(ctx context.Context, digest string, casBackendID, workflowRunID uuid.UUID) (*biz.CASMapping, error)

func (*CASMappingRepo) FindByDigest added in v0.17.0

func (r *CASMappingRepo) FindByDigest(ctx context.Context, digest string) ([]*biz.CASMapping, error)

type Data

type Data struct {
	// contains filtered or unexported fields
}

Data .

func NewData

func NewData(c *conf.Data, logger log.Logger) (*Data, func(), error)

NewData .

func (*Data) SchemaLoad added in v0.13.0

func (data *Data) SchemaLoad() error

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.IntegrationAttachment, error)

func (*IntegrationAttachmentRepo) SoftDelete

func (r *IntegrationAttachmentRepo) SoftDelete(ctx context.Context, id uuid.UUID) error

type IntegrationRepo

type IntegrationRepo struct {
	// contains filtered or unexported fields
}

func (*IntegrationRepo) Create

func (*IntegrationRepo) FindByIDInOrg

func (r *IntegrationRepo) FindByIDInOrg(ctx context.Context, orgID, id uuid.UUID) (*biz.Integration, error)

func (*IntegrationRepo) List

func (r *IntegrationRepo) List(ctx context.Context, orgID uuid.UUID) ([]*biz.Integration, error)

func (*IntegrationRepo) SoftDelete

func (r *IntegrationRepo) SoftDelete(ctx context.Context, id uuid.UUID) error

type MembershipRepo

type MembershipRepo struct {
	// contains filtered or unexported fields
}

func (*MembershipRepo) Create

func (r *MembershipRepo) Create(ctx context.Context, orgID, userID uuid.UUID, current bool) (*biz.Membership, error)

func (*MembershipRepo) Delete

func (r *MembershipRepo) Delete(ctx context.Context, id uuid.UUID) error

Delete deletes a membership by ID.

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) 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 OrgMetricsRepo

type OrgMetricsRepo struct {
	// contains filtered or unexported fields
}

func (*OrgMetricsRepo) RunsByRunnerTypeTotal

func (repo *OrgMetricsRepo) RunsByRunnerTypeTotal(ctx context.Context, orgID uuid.UUID, tw time.Duration) (map[string]int32, error)

func (*OrgMetricsRepo) RunsByStatusTotal

func (repo *OrgMetricsRepo) RunsByStatusTotal(ctx context.Context, orgID uuid.UUID, tw time.Duration) (map[string]int32, error)

func (*OrgMetricsRepo) RunsTotal

func (repo *OrgMetricsRepo) RunsTotal(ctx context.Context, orgID uuid.UUID, tw time.Duration) (int32, error)

func (*OrgMetricsRepo) TopWorkflowsByRunsCount

func (repo *OrgMetricsRepo) TopWorkflowsByRunsCount(ctx context.Context, orgID uuid.UUID, numWorkflows int, tw time.Duration) ([]*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) Delete

func (r *OrganizationRepo) Delete(ctx context.Context, id uuid.UUID) error

Delete deletes an organization by ID.

func (*OrganizationRepo) FindByID

func (r *OrganizationRepo) FindByID(ctx context.Context, id uuid.UUID) (*biz.Organization, 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)

func (*RobotAccountRepo) List

func (r *RobotAccountRepo) List(ctx context.Context, workflowID uuid.UUID, includeRevoked bool) ([]*biz.RobotAccount, error)

func (*RobotAccountRepo) Revoke

func (r *RobotAccountRepo) Revoke(ctx context.Context, orgID, id uuid.UUID) error

type WorkflowContractRepo

type WorkflowContractRepo struct {
	// contains filtered or unexported fields
}

func (*WorkflowContractRepo) Create

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) FindVersionByID

func (r *WorkflowContractRepo) FindVersionByID(ctx context.Context, versionID uuid.UUID) (*biz.WorkflowContractVersion, error)

func (*WorkflowContractRepo) List

func (*WorkflowContractRepo) SoftDelete

func (r *WorkflowContractRepo) SoftDelete(ctx context.Context, id uuid.UUID) error

func (*WorkflowContractRepo) Update

Update will add a new version of the contract. NOTE: ContractVersions are imutable

type WorkflowRepo

type WorkflowRepo struct {
	// contains filtered or unexported fields
}

func (*WorkflowRepo) ChangeVisibility added in v0.17.0

func (r *WorkflowRepo) ChangeVisibility(ctx context.Context, id uuid.UUID, public bool) (*biz.Workflow, error)

func (*WorkflowRepo) Create

func (r *WorkflowRepo) Create(ctx context.Context, opts *biz.CreateOpts) (*biz.Workflow, error)

func (*WorkflowRepo) FindByID

func (r *WorkflowRepo) FindByID(ctx context.Context, id uuid.UUID) (*biz.Workflow, error)

func (*WorkflowRepo) GetOrgScoped

func (r *WorkflowRepo) GetOrgScoped(ctx context.Context, orgID, workflowID uuid.UUID) (*biz.Workflow, error)

Get a workflow making sure it belongs to a given org

func (*WorkflowRepo) IncRunsCounter

func (r *WorkflowRepo) IncRunsCounter(ctx context.Context, workflowID uuid.UUID) error

func (*WorkflowRepo) List

func (r *WorkflowRepo) List(ctx context.Context, orgID uuid.UUID) ([]*biz.Workflow, error)

func (*WorkflowRepo) SoftDelete

func (r *WorkflowRepo) SoftDelete(ctx context.Context, id uuid.UUID) error

type WorkflowRunRepo

type WorkflowRunRepo struct {
	// contains filtered or unexported fields
}

func (*WorkflowRunRepo) Create

func (r *WorkflowRunRepo) Create(ctx context.Context, workflowID, robotaccountID, schemaVersionID uuid.UUID, runURL, runnerType string, backends []uuid.UUID) (*biz.WorkflowRun, error)

func (*WorkflowRunRepo) Expire

func (r *WorkflowRunRepo) Expire(ctx context.Context, id uuid.UUID) 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, workflowID uuid.UUID, p *pagination.Options) (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

func (*WorkflowRunRepo) SaveAttestation added in v0.11.1

func (r *WorkflowRunRepo) SaveAttestation(ctx context.Context, id uuid.UUID, att *dsse.Envelope, digest string) error

Save the attestation for a workflow run in the database

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL