Documentation
¶
Index ¶
- type CheckStoreOrm
- func (s *CheckStoreOrm) Count(ctx context.Context, repoID int64, commitSHA string, ...) (int, error)
- func (s *CheckStoreOrm) FindByIdentifier(ctx context.Context, repoID int64, commitSHA string, identifier string) (types.Check, error)
- func (s *CheckStoreOrm) List(ctx context.Context, repoID int64, commitSHA string, ...) ([]types.Check, error)
- func (s *CheckStoreOrm) ListRecent(ctx context.Context, repoID int64, opts types.CheckRecentOptions) ([]string, error)
- func (s *CheckStoreOrm) ListResults(ctx context.Context, repoID int64, commitSHA string) ([]types.CheckResult, error)
- func (s *CheckStoreOrm) ResultSummary(ctx context.Context, repoID int64, commitSHAs []string) (map[sha.SHA]types.CheckCountSummary, error)
- func (s *CheckStoreOrm) Upsert(ctx context.Context, check *types.Check) error
- type GitInfoView
- type OrmStore
- func (s *OrmStore) Count(ctx context.Context, parentID int64, filter *types.RepoFilter) (int64, error)
- func (s *OrmStore) CountAllWithoutParent(ctx context.Context, filter *types.RepoFilter) (int64, error)
- func (s *OrmStore) CountByRootSpaces(ctx context.Context) ([]types.RepositoryCount, error)
- func (s *OrmStore) CountMulti(ctx context.Context, parentIDs []int64, filter *types.RepoFilter) (int64, error)
- func (s *OrmStore) Create(ctx context.Context, repo *types.Repository) error
- func (s *OrmStore) CreateOrUpdateMirror(ctx context.Context, opts *types.RepositoryMirror) error
- func (s *OrmStore) Find(ctx context.Context, id int64) (*types.Repository, error)
- func (s *OrmStore) FindByRef(ctx context.Context, repoRef string) (*types.Repository, error)
- func (s *OrmStore) FindByRefAndDeletedAt(ctx context.Context, repoRef string, deletedAt int64) (*types.Repository, error)
- func (s *OrmStore) GetMirror(ctx context.Context, repoID int64) (*types.RepositoryMirror, error)
- func (s *OrmStore) GetPublicAccess(ctx context.Context, id int64) (bool, error)
- func (s *OrmStore) GetSize(ctx context.Context, id int64) (int64, error)
- func (s *OrmStore) List(ctx context.Context, parentID int64, filter *types.RepoFilter) ([]*types.Repository, error)
- func (s *OrmStore) ListAllMirrorRepo(ctx context.Context) ([]*types.RepositoryMirror, error)
- func (s *OrmStore) ListAllWithoutParent(ctx context.Context, filter *types.RepoFilter) ([]*types.Repository, error)
- func (s *OrmStore) ListMulti(ctx context.Context, parentIDs []int64, filter *types.RepoFilter) ([]*types.Repository, error)
- func (s *OrmStore) ListSizeInfos(ctx context.Context) ([]*types.RepositorySizeInfo, error)
- func (s *OrmStore) Purge(ctx context.Context, id int64, deletedAt *int64) error
- func (s *OrmStore) Restore(ctx context.Context, repo *types.Repository, newIdentifier *string, ...) (*types.Repository, error)
- func (s *OrmStore) SetPublicAccess(ctx context.Context, id int64, isPublic bool) error
- func (s *OrmStore) SoftDelete(ctx context.Context, repo *types.Repository, deletedAt int64) error
- func (s *OrmStore) Update(ctx context.Context, repo *types.Repository) error
- func (s *OrmStore) UpdateMirror(ctx context.Context, opts *types.RepositoryMirror) error
- func (s *OrmStore) UpdateOptLock(ctx context.Context, repo *types.Repository, ...) (*types.Repository, error)
- func (s *OrmStore) UpdateSize(ctx context.Context, id int64, size int64) error
- type RuleStore
- func (s *RuleStore) Count(ctx context.Context, spaceID, repoID *int64, filter *types.RuleFilter) (int64, error)
- func (s *RuleStore) Create(ctx context.Context, rule *types.Rule) error
- func (s *RuleStore) Delete(ctx context.Context, id int64) error
- func (s *RuleStore) DeleteByIdentifier(ctx context.Context, spaceID, repoID *int64, identifier string) error
- func (s *RuleStore) Find(ctx context.Context, id int64) (*types.Rule, error)
- func (s *RuleStore) FindBuildIn(ctx context.Context, identifier string, repoID int64) (*types.Rule, error)
- func (s *RuleStore) FindByIdentifier(ctx context.Context, spaceID *int64, repoID *int64, identifier string) (*types.Rule, error)
- func (s *RuleStore) List(ctx context.Context, spaceID, repoID *int64, filter *types.RuleFilter) ([]types.Rule, error)
- func (s *RuleStore) ListAllRepoRules(ctx context.Context, repoID int64) ([]types.RuleInfoInternal, error)
- func (s *RuleStore) Update(ctx context.Context, ruleObj *types.Rule) error
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.
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 ¶
func (s *GitInfoView) Find(ctx context.Context, id int64) (*types.RepositoryGitInfo, error)
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 (*OrmStore) CountByRootSpaces ¶
CountByRootSpaces counts total number of repositories grouped by root spaces.
func (*OrmStore) CountMulti ¶
func (*OrmStore) CreateOrUpdateMirror ¶
func (*OrmStore) FindByRef ¶
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) GetPublicAccess ¶
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 (*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 (*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 (*OrmStore) SoftDelete ¶
SoftDelete deletes a repo softly by setting the deleted timestamp.
func (*OrmStore) UpdateMirror ¶
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.
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) DeleteByIdentifier ¶
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 (*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.