repo

package
v0.0.0-...-4c964c4 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2025 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckStoreOrm

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

CheckStoreOrm implements store.CheckStore backed by a relational database.

func NewCheckStoreOrm

func NewCheckStoreOrm(
	db *gorm.DB,
	pCache store.PrincipalInfoCache,
) *CheckStoreOrm

NewCheckStoreOrm returns a new CheckStore.

func (*CheckStoreOrm) Count

func (s *CheckStoreOrm) Count(ctx context.Context,
	repoID int64,
	commitSHA string,
	opts types.CheckListOptions,
) (int, error)

Count counts status check results for a specific commit in a repo.

func (*CheckStoreOrm) FindByIdentifier

func (s *CheckStoreOrm) FindByIdentifier(
	ctx context.Context,
	repoID int64,
	commitSHA string,
	identifier string,
) (types.Check, error)

FindByIdentifier returns status check result for given unique key.

func (*CheckStoreOrm) List

func (s *CheckStoreOrm) List(ctx context.Context,
	repoID int64,
	commitSHA string,
	opts types.CheckListOptions,
) ([]types.Check, error)

List returns a list of status check results for a specific commit in a repo.

func (*CheckStoreOrm) ListRecent

func (s *CheckStoreOrm) ListRecent(ctx context.Context,
	repoID int64,
	opts types.CheckRecentOptions,
) ([]string, error)

ListRecent returns a list of recently executed status checks in a repository.

func (*CheckStoreOrm) ListResults

func (s *CheckStoreOrm) ListResults(ctx context.Context,
	repoID int64,
	commitSHA string,
) ([]types.CheckResult, error)

ListResults returns a list of status check results for a specific commit in a repo.

func (*CheckStoreOrm) ResultSummary

func (s *CheckStoreOrm) ResultSummary(ctx context.Context,
	repoID int64,
	commitSHAs []string,
) (map[sha.SHA]types.CheckCountSummary, error)

ResultSummary returns a list of status check result summaries for the provided list of commits in a repo.

func (*CheckStoreOrm) Upsert

func (s *CheckStoreOrm) Upsert(ctx context.Context, check *types.Check) error

Upsert creates new or updates an existing status check result.

type GitInfoView

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

func NewRepoGitOrmInfoView

func NewRepoGitOrmInfoView(db *gorm.DB) *GitInfoView

NewRepoGitOrmInfoView returns a new GitInfoView. It's used by the repository git UID cache.

func (*GitInfoView) Find

type OrmStore

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

OrmStore implements a store.RepoStore backed by a relational database.

func NewRepoOrmStore

func NewRepoOrmStore(
	db *gorm.DB,
	spacePathCache store.SpacePathCache,
	spacePathStore store.SpacePathStore,
	spaceStore store.SpaceStore,
) *OrmStore

NewRepoOrmStore returns a new OrmStore.

func (*OrmStore) Count

func (s *OrmStore) Count(
	ctx context.Context,
	parentID int64,
	filter *types.RepoFilter,
) (int64, error)

Count of active repos in a space. if parentID (space) is zero then it will count all repositories in the system. Count deleted repos requires opts.DeletedBeforeOrAt filter.

func (*OrmStore) CountAllWithoutParent

func (s *OrmStore) CountAllWithoutParent(ctx context.Context, filter *types.RepoFilter) (int64, error)

func (*OrmStore) CountByRootSpaces

func (s *OrmStore) CountByRootSpaces(
	ctx context.Context,
) ([]types.RepositoryCount, error)

CountByRootSpaces counts total number of repositories grouped by root spaces.

func (*OrmStore) CountMulti

func (s *OrmStore) CountMulti(
	ctx context.Context,
	parentIDs []int64,
	filter *types.RepoFilter,
) (int64, error)

func (*OrmStore) Create

func (s *OrmStore) Create(ctx context.Context, repo *types.Repository) error

Create creates a new repository.

func (*OrmStore) CreateOrUpdateMirror

func (s *OrmStore) CreateOrUpdateMirror(ctx context.Context, opts *types.RepositoryMirror) error

func (*OrmStore) Find

func (s *OrmStore) Find(ctx context.Context, id int64) (*types.Repository, error)

Find finds the repo by id.

func (*OrmStore) FindByRef

func (s *OrmStore) FindByRef(ctx context.Context, repoRef string) (*types.Repository, error)

FindByRef finds the repo using the repoRef as either the id or the repo path.

func (*OrmStore) FindByRefAndDeletedAt

func (s *OrmStore) FindByRefAndDeletedAt(
	ctx context.Context,
	repoRef string,
	deletedAt int64,
) (*types.Repository, error)

FindByRefAndDeletedAt finds the repo using the repoRef and deleted timestamp.

func (*OrmStore) GetMirror

func (s *OrmStore) GetMirror(ctx context.Context, repoID int64) (*types.RepositoryMirror, error)

func (*OrmStore) GetPublicAccess

func (s *OrmStore) GetPublicAccess(ctx context.Context, id int64) (bool, error)

func (*OrmStore) GetSize

func (s *OrmStore) GetSize(ctx context.Context, id int64) (int64, error)

GetSize returns the repo size.

func (*OrmStore) List

func (s *OrmStore) List(
	ctx context.Context,
	parentID int64,
	filter *types.RepoFilter,
) ([]*types.Repository, error)

List returns a list of active repos in a space. With "DeletedBeforeOrAt" filter, lists deleted repos by opts.DeletedBeforeOrAt.

func (*OrmStore) ListAllMirrorRepo

func (s *OrmStore) ListAllMirrorRepo(ctx context.Context) ([]*types.RepositoryMirror, error)

func (*OrmStore) ListAllWithoutParent

func (s *OrmStore) ListAllWithoutParent(ctx context.Context, filter *types.RepoFilter) ([]*types.Repository, error)

func (*OrmStore) ListMulti

func (s *OrmStore) ListMulti(
	ctx context.Context,
	parentIDs []int64,
	filter *types.RepoFilter,
) ([]*types.Repository, error)

ListMulti returns a list of active repos in multi space. With "DeletedBeforeOrAt" filter, lists deleted repos by opts.DeletedBeforeOrAt.

func (*OrmStore) ListSizeInfos

func (s *OrmStore) ListSizeInfos(ctx context.Context) ([]*types.RepositorySizeInfo, error)

func (*OrmStore) Purge

func (s *OrmStore) Purge(ctx context.Context, id int64, deletedAt *int64) error

Purge deletes the repo permanently.

func (*OrmStore) Restore

func (s *OrmStore) Restore(
	ctx context.Context,
	repo *types.Repository,
	newIdentifier *string,
	newParentID *int64,
) (*types.Repository, error)

Restore restores a deleted repo.

func (*OrmStore) SetPublicAccess

func (s *OrmStore) SetPublicAccess(ctx context.Context, id int64, isPublic bool) error

func (*OrmStore) SoftDelete

func (s *OrmStore) SoftDelete(ctx context.Context, repo *types.Repository, deletedAt int64) error

SoftDelete deletes a repo softly by setting the deleted timestamp.

func (*OrmStore) Update

func (s *OrmStore) Update(ctx context.Context, repo *types.Repository) error

Update updates the repo details.

func (*OrmStore) UpdateMirror

func (s *OrmStore) UpdateMirror(ctx context.Context, opts *types.RepositoryMirror) error

func (*OrmStore) UpdateOptLock

func (s *OrmStore) UpdateOptLock(
	ctx context.Context,
	repo *types.Repository,
	mutateFn func(repository *types.Repository) error,
) (*types.Repository, error)

UpdateOptLock updates the active repository using the optimistic locking mechanism.

func (*OrmStore) UpdateSize

func (s *OrmStore) UpdateSize(ctx context.Context, id int64, size int64) error

UpdateSize updates the size of a specific repository in the database.

type RuleStore

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

RuleStore implements a store.RuleStore backed by a relational database.

func NewRuleOrmStore

func NewRuleOrmStore(
	db *gorm.DB,
	pCache store.PrincipalInfoCache,
) *RuleStore

NewRuleOrmStore returns a new RuleStore.

func (*RuleStore) Count

func (s *RuleStore) Count(ctx context.Context, spaceID, repoID *int64, filter *types.RuleFilter) (int64, error)

Count returns count of protection rules matching the provided criteria.

func (*RuleStore) Create

func (s *RuleStore) Create(ctx context.Context, rule *types.Rule) error

Create creates a new protection rule.

func (*RuleStore) Delete

func (s *RuleStore) Delete(ctx context.Context, id int64) error

Delete the protection rule.

func (*RuleStore) DeleteByIdentifier

func (s *RuleStore) DeleteByIdentifier(ctx context.Context, spaceID, repoID *int64, identifier string) error

func (*RuleStore) Find

func (s *RuleStore) Find(ctx context.Context, id int64) (*types.Rule, error)

Find finds the rule by id.

func (*RuleStore) FindBuildIn

func (s *RuleStore) FindBuildIn(ctx context.Context, identifier string, repoID int64) (*types.Rule, error)

FindBuildIn finds the buildin rule by identifier.

func (*RuleStore) FindByIdentifier

func (s *RuleStore) FindByIdentifier(
	ctx context.Context,
	spaceID *int64,
	repoID *int64,
	identifier string,
) (*types.Rule, error)

func (*RuleStore) List

func (s *RuleStore) List(ctx context.Context, spaceID, repoID *int64, filter *types.RuleFilter) ([]types.Rule, error)

List returns a list of protection rules of a repository or a space.

func (*RuleStore) ListAllRepoRules

func (s *RuleStore) ListAllRepoRules(ctx context.Context, repoID int64) ([]types.RuleInfoInternal, error)

ListAllRepoRules returns a list of all protection rules that can be applied on a repository. This includes the rules defined directly on the repository and all those defined on the parent spaces.

func (*RuleStore) Update

func (s *RuleStore) Update(ctx context.Context, ruleObj *types.Rule) error

Update updates the protection rule details.

Jump to

Keyboard shortcuts

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