projects

package
v0.4.0-rc.12-linux-arm64 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2026 License: Apache-2.0 Imports: 13 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound                             = xerror.NotFound(xerror.Project)
	ErrSlugTaken                            = xerror.AlreadyExists(xerror.Project)
	ErrInvalidSortBy                        = xerror.InvalidInput(xerror.Project)
	ErrPipelineBackendDataSourceUnavailable = xerror.Unavailable(xerror.DataSource)
	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 CreateParams

type CreateParams struct {
	OrgSlug slug.Slug
	Slug    slug.Slug
	Name    string
}

type Project

type Project struct {
	Slug                          slug.Slug
	Name                          string
	PipelineBackendDataSourceSlug *slug.Slug
	PipelineBackendRepo           *string
	PipelineBackendTrackedBranch  *string
	PipelineBackendPipelineDir    *string
	PipelineBackendFirstCommitSHA *string
	CreatedAt                     time.Time
	UpdatedAt                     time.Time
}

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
}

type UpdateParams

type UpdateParams struct {
	OrgSlug slug.Slug
	Slug    slug.Slug
	Name    string
}

Jump to

Keyboard shortcuts

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