Documentation
¶
Index ¶
- Variables
- type BindProposalAuthorityParams
- type CreateParams
- type Project
- type Repository
- type RepositoryWithLogging
- func (_d RepositoryWithLogging) BindGitBranchProposalAuthority(ctx context.Context, d1 postgres.DBTX, b1 BindProposalAuthorityParams) (err error)
- func (_d RepositoryWithLogging) BindGitHubProposalAuthority(ctx context.Context, d1 postgres.DBTX, b1 BindProposalAuthorityParams) (err error)
- func (_d RepositoryWithLogging) ClearPipelineBackend(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, ...) (err error)
- func (_d RepositoryWithLogging) Create(ctx context.Context, tx postgres.DBTX, params *CreateParams) (pp1 *Project, err error)
- func (_d RepositoryWithLogging) Delete(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, ...) (err error)
- func (_d RepositoryWithLogging) FindBySlug(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, ...) (pp1 *Project, err error)
- func (_d RepositoryWithLogging) FindBySlugForUpdate(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, ...) (pp1 *Project, err error)
- func (_d RepositoryWithLogging) ListByOrg(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, ...) (ppa1 []*Project, err error)
- func (_d RepositoryWithLogging) RevokeChangedProposalAuthority(ctx context.Context, d1 postgres.DBTX, b1 BindProposalAuthorityParams) (err error)
- func (_d RepositoryWithLogging) SetPipelineBackend(ctx context.Context, tx postgres.DBTX, params *SetPipelineBackendParams) (err error)
- func (_d RepositoryWithLogging) Update(ctx context.Context, tx postgres.DBTX, params *UpdateParams) (err error)
- type SetPipelineBackendParams
- type UpdateParams
Constants ¶
This section is empty.
Variables ¶
var ( ErrNotFound = xerror.NotFound(xerror.Project) ErrSlugTaken = xerror.AlreadyExists(xerror.Project) ErrInvalidSortBy = xerror.InvalidInput(xerror.Project) ErrPipelineBackendTaken = xerror.AlreadyExists(xerror.Project) )
Functions ¶
This section is empty.
Types ¶
type BindProposalAuthorityParams ¶
type BindProposalAuthorityParams struct {
OrgSlug, ProjectSlug, DataSourceSlug, CredentialSlug slug.Slug
Authority model.PipelineProposalAuthority
}
BindProposalAuthorityParams pins the verified provider identity to the current project backend.
type Repository ¶
type Repository interface {
Create(ctx context.Context, tx postgres.DBTX, params *CreateParams) (*Project, error)
FindBySlug(
ctx context.Context,
tx postgres.DBTX,
orgSlug, projectSlug slug.Slug,
) (*Project, error)
FindBySlugForUpdate(
ctx context.Context,
tx postgres.DBTX,
orgSlug, projectSlug slug.Slug,
) (*Project, error)
ListByOrg(
ctx context.Context,
tx postgres.DBTX,
orgSlug slug.Slug,
req model.ListRequest,
) ([]*Project, error)
Update(ctx context.Context, tx postgres.DBTX, params *UpdateParams) error
SetPipelineBackend(
ctx context.Context,
tx postgres.DBTX,
params *SetPipelineBackendParams,
) error
RevokeChangedProposalAuthority(context.Context, postgres.DBTX, BindProposalAuthorityParams) error
BindGitHubProposalAuthority(context.Context, postgres.DBTX, BindProposalAuthorityParams) error
BindGitBranchProposalAuthority(context.Context, postgres.DBTX, BindProposalAuthorityParams) error
ClearPipelineBackend(ctx context.Context, tx postgres.DBTX, orgSlug, projectSlug slug.Slug) error
Delete(ctx context.Context, tx postgres.DBTX, orgSlug, projectSlug slug.Slug) error
}
Repository provides access to project persistence.
func NewRepository ¶
func NewRepository() Repository
func NewRepositoryWithLogging ¶
func NewRepositoryWithLogging(base Repository, logger *slog.Logger) Repository
NewRepositoryWithLogging wraps base with method completion logging.
type RepositoryWithLogging ¶
type RepositoryWithLogging struct {
// contains filtered or unexported fields
}
RepositoryWithLogging implements Repository with method completion logging.
func (RepositoryWithLogging) BindGitBranchProposalAuthority ¶
func (_d RepositoryWithLogging) BindGitBranchProposalAuthority(ctx context.Context, d1 postgres.DBTX, b1 BindProposalAuthorityParams) (err error)
BindGitBranchProposalAuthority implements Repository.
func (RepositoryWithLogging) BindGitHubProposalAuthority ¶
func (_d RepositoryWithLogging) BindGitHubProposalAuthority(ctx context.Context, d1 postgres.DBTX, b1 BindProposalAuthorityParams) (err error)
BindGitHubProposalAuthority implements Repository.
func (RepositoryWithLogging) ClearPipelineBackend ¶
func (_d RepositoryWithLogging) ClearPipelineBackend(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, projectSlug slug.Slug) (err error)
ClearPipelineBackend implements Repository.
func (RepositoryWithLogging) Create ¶
func (_d RepositoryWithLogging) Create(ctx context.Context, tx postgres.DBTX, params *CreateParams) (pp1 *Project, err error)
Create implements Repository.
func (RepositoryWithLogging) Delete ¶
func (_d RepositoryWithLogging) Delete(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, projectSlug slug.Slug) (err error)
Delete implements Repository.
func (RepositoryWithLogging) FindBySlug ¶
func (_d RepositoryWithLogging) FindBySlug(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, projectSlug slug.Slug) (pp1 *Project, err error)
FindBySlug implements Repository.
func (RepositoryWithLogging) FindBySlugForUpdate ¶
func (_d RepositoryWithLogging) FindBySlugForUpdate(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, projectSlug slug.Slug) (pp1 *Project, err error)
FindBySlugForUpdate implements Repository.
func (RepositoryWithLogging) ListByOrg ¶
func (_d RepositoryWithLogging) ListByOrg(ctx context.Context, tx postgres.DBTX, orgSlug slug.Slug, req model.ListRequest) (ppa1 []*Project, err error)
ListByOrg implements Repository.
func (RepositoryWithLogging) RevokeChangedProposalAuthority ¶
func (_d RepositoryWithLogging) RevokeChangedProposalAuthority(ctx context.Context, d1 postgres.DBTX, b1 BindProposalAuthorityParams) (err error)
RevokeChangedProposalAuthority implements Repository.
func (RepositoryWithLogging) SetPipelineBackend ¶
func (_d RepositoryWithLogging) SetPipelineBackend(ctx context.Context, tx postgres.DBTX, params *SetPipelineBackendParams) (err error)
SetPipelineBackend implements Repository.
func (RepositoryWithLogging) Update ¶
func (_d RepositoryWithLogging) Update(ctx context.Context, tx postgres.DBTX, params *UpdateParams) (err error)
Update implements Repository.
type SetPipelineBackendParams ¶
type SetPipelineBackendParams struct {
OrgSlug slug.Slug
Slug slug.Slug
PipelineBackendDataSourceSlug slug.Slug
// PipelineBackendRepo is the normalized external repo identity resolved from
// the git data source config. It is not an FK because repos are not local DB rows.
PipelineBackendRepo string
PipelineBackendTrackedBranch string
PipelineBackendPipelineDir string
PipelineBackendFirstCommitSHA *string
}