Documentation
¶
Index ¶
- Constants
- Variables
- func EncodeToSQLXJSON(v any) sqlx.JSONText
- func NewConnectorStore(db *sqlx.DB, secretStore store.SecretStore) store.ConnectorStore
- func NewExecutionStore(db *sqlx.DB) store.ExecutionStore
- func NewGitspaceConfigStore(db *sqlx.DB, pCache store.PrincipalInfoCache, ...) store.GitspaceConfigStore
- func NewGitspaceEventStore(db *sqlx.DB) store.GitspaceEventStore
- func NewGitspaceInstanceStore(db *sqlx.DB) store.GitspaceInstanceStore
- func NewInfraProviderConfigStore(db *sqlx.DB) store.InfraProviderConfigStore
- func NewInfraProviderResourceStore(db *sqlx.DB) store.InfraProviderResourceStore
- func NewInfraProviderTemplateStore(db *sqlx.DB) store.InfraProviderTemplateStore
- func NewInfraProvisionedStore(db *sqlx.DB) store.InfraProvisionedStore
- func NewLabelStore(db *sqlx.DB) store.LabelStore
- func NewLabelValueStore(db *sqlx.DB) store.LabelValueStore
- func NewPipelineStore(db *sqlx.DB) store.PipelineStore
- func NewPluginStore(db *sqlx.DB) store.PluginStore
- func NewPullReqLabelStore(db *sqlx.DB) store.PullReqLabelAssignmentStore
- func NewSecretStore(db *sqlx.DB) store.SecretStore
- func NewStageStore(db *sqlx.DB) store.StageStore
- func NewStepStore(db *sqlx.DB) store.StepStore
- func NewTemplateStore(db *sqlx.DB) store.TemplateStore
- func NewTriggerStore(db *sqlx.DB) store.TriggerStore
- func PartialMatch(column, value string) (string, string)
- func ProvideAIStore(db *gorm.DB) store.AIStore
- func ProvideArtifactStore(orm *gorm.DB) store.ArtifactStore
- func ProvideCheckStore(db *gorm.DB, principalInfoCache store.PrincipalInfoCache) store.CheckStore
- func ProvideCodeCommentView(db *gorm.DB) store.CodeCommentView
- func ProvideConnectorStore(db *gorm.DB, secretStore store.SecretStore) store.ConnectorStore
- func ProvideDatabase(ctx context.Context, config database.Config) (*sqlx.DB, error)
- func ProvideExecutionStore(db *gorm.DB) store.ExecutionStore
- func ProvideGitspaceConfigStore(db *gorm.DB, pCache store.PrincipalInfoCache, ...) store.GitspaceConfigStore
- func ProvideGitspaceEventStore(db *gorm.DB) store.GitspaceEventStore
- func ProvideGitspaceInstanceStore(db *gorm.DB) store.GitspaceInstanceStore
- func ProvideGormDatabase(ctx context.Context, dbConfig database.Config, config *types.Config, ...) (*gorm.DB, error)
- func ProvideInfraProviderConfigStore(db *gorm.DB) store.InfraProviderConfigStore
- func ProvideInfraProviderResourceStore(db *gorm.DB) store.InfraProviderResourceStore
- func ProvideInfraProviderResourceView(db *gorm.DB) store.InfraProviderResourceView
- func ProvideInfraProviderTemplateStore(db *gorm.DB) store.InfraProviderTemplateStore
- func ProvideInfraProvisionedStore(db *gorm.DB) store.InfraProvisionedStore
- func ProvideJobStore(db *gorm.DB) job.Store
- func ProvideLabelStore(db *gorm.DB) store.LabelStore
- func ProvideLabelValueStore(db *gorm.DB) store.LabelValueStore
- func ProvideMembershipStore(db *gorm.DB, principalInfoCache store.PrincipalInfoCache, ...) store.MembershipStore
- func ProvidePipelineStore(db *gorm.DB) store.PipelineStore
- func ProvidePluginStore(db *gorm.DB) store.PluginStore
- func ProvidePrincipalInfoView(db *gorm.DB) store.PrincipalInfoView
- func ProvidePrincipalStore(db *gorm.DB, uidTransformation store.PrincipalUIDTransformation) store.PrincipalStore
- func ProvidePublicAccessStore(db *gorm.DB) store.PublicAccessStore
- func ProvidePublicKeyStore(db *gorm.DB) store.PublicKeyStore
- func ProvidePullReqActivityStore(db *gorm.DB, principalInfoCache store.PrincipalInfoCache) store.PullReqActivityStore
- func ProvidePullReqFileViewStore(db *gorm.DB) store.PullReqFileViewStore
- func ProvidePullReqLabelStore(db *gorm.DB) store.PullReqLabelAssignmentStore
- func ProvidePullReqReviewStore(db *gorm.DB) store.PullReqReviewStore
- func ProvidePullReqReviewerStore(db *gorm.DB, principalInfoCache store.PrincipalInfoCache) store.PullReqReviewerStore
- func ProvidePullReqStore(db *gorm.DB, principalInfoCache store.PrincipalInfoCache) store.PullReqStore
- func ProvideRepoGitInfoView(db *gorm.DB) store.RepoGitInfoView
- func ProvideRepoStore(db *gorm.DB, spacePathCache store.SpacePathCache, ...) store.RepoStore
- func ProvideRuleStore(db *gorm.DB, principalInfoCache store.PrincipalInfoCache) store.RuleStore
- func ProvideSecretStore(db *gorm.DB) store.SecretStore
- func ProvideSettingsStore(db *gorm.DB) store.SettingsStore
- func ProvideSpacePathStore(db *gorm.DB, spacePathTransformation store.SpacePathTransformation) store.SpacePathStore
- func ProvideSpaceStore(db *gorm.DB, spacePathCache store.SpacePathCache, ...) store.SpaceStore
- func ProvideStageStore(db *gorm.DB) store.StageStore
- func ProvideStepStore(db *gorm.DB) store.StepStore
- func ProvideTemplateStore(db *gorm.DB) store.TemplateStore
- func ProvideTokenStore(db *gorm.DB) store.TokenStore
- func ProvideTriggerStore(db *gorm.DB) store.TriggerStore
- func ProvideUserGroupReviewerStore(db *gorm.DB, pInfoCache store.PrincipalInfoCache, ...) store.UserGroupReviewersStore
- func ProvideUserGroupStore(db *gorm.DB) store.UserGroupStore
- func ProvideWebhookExecutionStore(db *gorm.DB) store.WebhookExecutionStore
- func ProvideWebhookStore(db *gorm.DB) store.WebhookStore
- type AIStore
- func (s AIStore) Count(ctx context.Context, spaceID int64) (int64, error)
- func (s AIStore) Create(ctx context.Context, cfg *types.AIConfig) error
- func (s AIStore) Default(ctx context.Context, spaceID int64) (*types.AIConfig, error)
- func (s AIStore) Delete(ctx context.Context, id int64) error
- func (s AIStore) Find(ctx context.Context, spaceID int64) (*types.AIConfig, error)
- func (s AIStore) LastRecord(ctx context.Context, prID int64) (*types.AIRequest, error)
- func (s AIStore) List(ctx context.Context, spaceID int64) ([]types.AIConfig, error)
- func (s AIStore) Record(ctx context.Context, aiReq *types.AIRequest) error
- func (s AIStore) Update(ctx context.Context, cfg *types.AIConfig) error
- type CheckStore
- func (s *CheckStore) Count(ctx context.Context, repoID int64, commitSHA string, ...) (int, error)
- func (s *CheckStore) FindByIdentifier(ctx context.Context, repoID int64, commitSHA string, identifier string) (types.Check, error)
- func (s *CheckStore) List(ctx context.Context, repoID int64, commitSHA string, ...) ([]types.Check, error)
- func (s *CheckStore) ListRecent(ctx context.Context, repoID int64, opts types.CheckRecentOptions) ([]string, error)
- func (s *CheckStore) ListResults(ctx context.Context, repoID int64, commitSHA string) ([]types.CheckResult, error)
- func (s *CheckStore) ResultSummary(ctx context.Context, repoID int64, commitSHAs []string) (map[sha.SHA]types.CheckCountSummary, error)
- func (s *CheckStore) Upsert(ctx context.Context, check *types.Check) error
- type CodeCommentView
- func (s *CodeCommentView) ListNotAtMergeBaseSHA(ctx context.Context, prID int64, mergeBaseSHA string) ([]*types.CodeComment, error)
- func (s *CodeCommentView) ListNotAtSourceSHA(ctx context.Context, prID int64, sourceSHA string) ([]*types.CodeComment, error)
- func (s *CodeCommentView) UpdateAll(ctx context.Context, codeComments []*types.CodeComment) error
- type InfraProviderResourceView
- type JobStore
- func (s *JobStore) CountRunning(ctx context.Context) (int, error)
- func (s *JobStore) Create(ctx context.Context, job *job.Job) error
- func (s *JobStore) DeleteByGroupID(ctx context.Context, groupID string) (int64, error)
- func (s *JobStore) DeleteByUID(ctx context.Context, jobUID string) error
- func (s *JobStore) DeleteOld(ctx context.Context, olderThan time.Time) (int64, error)
- func (s *JobStore) Find(ctx context.Context, uid string) (*job.Job, error)
- func (s *JobStore) ListByGroupID(ctx context.Context, groupID string) ([]*job.Job, error)
- func (s *JobStore) ListDeadlineExceeded(ctx context.Context, now time.Time) ([]*job.Job, error)
- func (s *JobStore) ListReady(ctx context.Context, now time.Time, limit int) ([]*job.Job, error)
- func (s *JobStore) NextScheduledTime(ctx context.Context, now time.Time) (time.Time, error)
- func (s *JobStore) UpdateDefinition(ctx context.Context, job *job.Job) error
- func (s *JobStore) UpdateExecution(ctx context.Context, job *job.Job) error
- func (s *JobStore) UpdateProgress(ctx context.Context, job *job.Job) error
- func (s *JobStore) Upsert(ctx context.Context, job *job.Job) error
- type MembershipStore
- func (s *MembershipStore) CountSpaces(ctx context.Context, userID int64, filter types.MembershipSpaceFilter) (int64, error)
- func (s *MembershipStore) CountUsers(ctx context.Context, spaceID int64, filter types.MembershipUserFilter) (int64, error)
- func (s *MembershipStore) Create(ctx context.Context, membership *types.Membership) error
- func (s *MembershipStore) Delete(ctx context.Context, key types.MembershipKey) error
- func (s *MembershipStore) Find(ctx context.Context, key types.MembershipKey) (*types.Membership, error)
- func (s *MembershipStore) FindUser(ctx context.Context, key types.MembershipKey) (*types.MembershipUser, error)
- func (s *MembershipStore) ListSpaces(ctx context.Context, userID int64, filter types.MembershipSpaceFilter) ([]types.MembershipSpace, error)
- func (s *MembershipStore) ListUserSpaces(ctx context.Context, userID int64) ([]int64, error)
- func (s *MembershipStore) ListUsers(ctx context.Context, spaceID int64, filter types.MembershipUserFilter) ([]types.MembershipUser, error)
- func (s *MembershipStore) Update(ctx context.Context, membership *types.Membership) error
- type PrincipalInfoView
- type PrincipalStore
- func (s *PrincipalStore) CountServiceAccounts(ctx context.Context, parentType enum.ParentResourceType, parentID int64) (int64, error)
- func (s *PrincipalStore) CountServices(ctx context.Context) (int64, error)
- func (s *PrincipalStore) CountUsers(ctx context.Context, opts *types.UserFilter) (int64, error)
- func (s *PrincipalStore) CreateService(ctx context.Context, svc *types.Service) error
- func (s *PrincipalStore) CreateServiceAccount(ctx context.Context, sa *types.ServiceAccount) error
- func (s *PrincipalStore) CreateUser(ctx context.Context, user *types.User) error
- func (s *PrincipalStore) DeleteService(ctx context.Context, id int64) error
- func (s *PrincipalStore) DeleteServiceAccount(ctx context.Context, id int64) error
- func (s *PrincipalStore) DeleteUser(ctx context.Context, id int64) error
- func (s *PrincipalStore) Find(ctx context.Context, id int64) (*types.Principal, error)
- func (s *PrincipalStore) FindByEmail(ctx context.Context, email string) (*types.Principal, error)
- func (s *PrincipalStore) FindByUID(ctx context.Context, uid string) (*types.Principal, error)
- func (s *PrincipalStore) FindManyByUID(ctx context.Context, uids []string) ([]*types.Principal, error)
- func (s *PrincipalStore) FindService(ctx context.Context, id int64) (*types.Service, error)
- func (s *PrincipalStore) FindServiceAccount(ctx context.Context, id int64) (*types.ServiceAccount, error)
- func (s *PrincipalStore) FindServiceAccountByUID(ctx context.Context, uid string) (*types.ServiceAccount, error)
- func (s *PrincipalStore) FindServiceByUID(ctx context.Context, uid string) (*types.Service, error)
- func (s *PrincipalStore) FindUser(ctx context.Context, id int64) (*types.User, error)
- func (s *PrincipalStore) FindUserByEmail(ctx context.Context, email string) (*types.User, error)
- func (s *PrincipalStore) FindUserByUID(ctx context.Context, uid string) (*types.User, error)
- func (s *PrincipalStore) List(ctx context.Context, opts *types.PrincipalFilter) ([]*types.Principal, error)
- func (s *PrincipalStore) ListServiceAccounts(ctx context.Context, parentType enum.ParentResourceType, parentID int64) ([]*types.ServiceAccount, error)
- func (s *PrincipalStore) ListServices(ctx context.Context) ([]*types.Service, error)
- func (s *PrincipalStore) ListUsers(ctx context.Context, opts *types.UserFilter) ([]*types.User, error)
- func (s *PrincipalStore) UpdateService(ctx context.Context, svc *types.Service) error
- func (s *PrincipalStore) UpdateServiceAccount(ctx context.Context, sa *types.ServiceAccount) error
- func (s *PrincipalStore) UpdateUser(ctx context.Context, user *types.User) error
- type PublicAccessStore
- func (p *PublicAccessStore) Create(ctx context.Context, typ enum.PublicResourceType, id int64) error
- func (p *PublicAccessStore) Delete(ctx context.Context, typ enum.PublicResourceType, id int64) error
- func (p *PublicAccessStore) Find(ctx context.Context, typ enum.PublicResourceType, id int64) (bool, error)
- type PublicKeyStore
- func (s PublicKeyStore) Count(ctx context.Context, principalID int64, filter *types.PublicKeyFilter) (int, error)
- func (s PublicKeyStore) Create(ctx context.Context, key *types.PublicKey) error
- func (s PublicKeyStore) DeleteByIdentifier(ctx context.Context, principalID int64, identifier string) error
- func (s PublicKeyStore) Find(ctx context.Context, id int64) (*types.PublicKey, error)
- func (s PublicKeyStore) FindByIdentifier(ctx context.Context, principalID int64, identifier string) (*types.PublicKey, error)
- func (s PublicKeyStore) List(ctx context.Context, principalID int64, filter *types.PublicKeyFilter) ([]types.PublicKey, error)
- func (s PublicKeyStore) ListByFingerprint(ctx context.Context, fingerprint string) ([]types.PublicKey, error)
- func (s PublicKeyStore) MarkAsVerified(ctx context.Context, id int64, verified int64) error
- type PullReqActivityStore
- func (s *PullReqActivityStore) Count(ctx context.Context, prID int64, opts *types.PullReqActivityFilter) (int64, error)
- func (s *PullReqActivityStore) CountUnresolved(ctx context.Context, prID int64) (int, error)
- func (s *PullReqActivityStore) Create(ctx context.Context, act *types.PullReqActivity) error
- func (s *PullReqActivityStore) CreateWithPayload(ctx context.Context, pr *types.PullReq, principalID int64, ...) (*types.PullReqActivity, error)
- func (s *PullReqActivityStore) Find(ctx context.Context, id int64) (*types.PullReqActivity, error)
- func (s *PullReqActivityStore) List(ctx context.Context, prID int64, filter *types.PullReqActivityFilter) ([]*types.PullReqActivity, error)
- func (s *PullReqActivityStore) ListAuthorIDs(ctx context.Context, prID int64, order int64) ([]int64, error)
- func (s *PullReqActivityStore) Update(ctx context.Context, act *types.PullReqActivity) error
- func (s *PullReqActivityStore) UpdateOptLock(ctx context.Context, act *types.PullReqActivity, ...) (*types.PullReqActivity, error)
- type PullReqFileViewStore
- func (s *PullReqFileViewStore) DeleteByFileForPrincipal(ctx context.Context, prID int64, principalID int64, filePath string) error
- func (s *PullReqFileViewStore) List(ctx context.Context, prID int64, principalID int64) ([]*types.PullReqFileView, error)
- func (s *PullReqFileViewStore) MarkObsolete(ctx context.Context, prID int64, filePaths []string) error
- func (s *PullReqFileViewStore) Upsert(ctx context.Context, view *types.PullReqFileView) error
- type PullReqReviewStore
- type PullReqReviewerStore
- func (s *PullReqReviewerStore) Create(ctx context.Context, v *types.PullReqReviewer) error
- func (s *PullReqReviewerStore) Delete(ctx context.Context, prID, reviewerID int64) error
- func (s *PullReqReviewerStore) Find(ctx context.Context, prID, principalID int64) (*types.PullReqReviewer, error)
- func (s *PullReqReviewerStore) List(ctx context.Context, prID int64) ([]*types.PullReqReviewer, error)
- func (s *PullReqReviewerStore) Update(ctx context.Context, v *types.PullReqReviewer) error
- type PullReqStore
- func (s *PullReqStore) Count(ctx context.Context, opts *types.PullReqFilter) (int64, error)
- func (s *PullReqStore) Create(ctx context.Context, pr *types.PullReq) error
- func (s *PullReqStore) Delete(ctx context.Context, id int64) error
- func (s *PullReqStore) Find(ctx context.Context, id int64) (*types.PullReq, error)
- func (s *PullReqStore) FindByNumber(ctx context.Context, repoID, number int64) (*types.PullReq, error)
- func (s *PullReqStore) FindByNumberWithLock(ctx context.Context, repoID, number int64) (*types.PullReq, error)
- func (s *PullReqStore) GetUnmergedPullRequest(ctx context.Context, sourceRepo, targetRepo int64, ...) (*types.PullReq, bool, error)
- func (s *PullReqStore) List(ctx context.Context, opts *types.PullReqFilter) ([]*types.PullReq, error)
- func (s *PullReqStore) ListOpenByBranchName(ctx context.Context, repoID int64, branchNames []string) (map[string][]*types.PullReq, error)
- func (s *PullReqStore) ResetMergeCheckStatus(ctx context.Context, targetRepo int64, targetBranch string) error
- func (s *PullReqStore) Stream(ctx context.Context, opts *types.PullReqFilter) (<-chan *types.PullReq, <-chan error)
- func (s *PullReqStore) SummaryCount(ctx context.Context, opts *types.PullReqSummaryFilter) (*types.PullReqSummary, error)
- func (s *PullReqStore) Update(ctx context.Context, pr *types.PullReq) error
- func (s *PullReqStore) UpdateActivitySeq(ctx context.Context, pr *types.PullReq) (*types.PullReq, error)
- func (s *PullReqStore) UpdateOptLock(ctx context.Context, pr *types.PullReq, mutateFn func(pr *types.PullReq) error) (*types.PullReq, error)
- type RepoGitInfoView
- type RepoStore
- func (s *RepoStore) Count(ctx context.Context, parentID int64, filter *types.RepoFilter) (int64, error)
- func (s *RepoStore) CountAllWithoutParent(ctx context.Context, filter *types.RepoFilter) (int64, error)
- func (s *RepoStore) CountByRootSpaces(ctx context.Context) ([]types.RepositoryCount, error)
- func (s *RepoStore) CountMulti(ctx context.Context, parentIDs []int64, opts *types.RepoFilter) (int64, error)
- func (s *RepoStore) Create(ctx context.Context, repo *types.Repository) error
- func (s *RepoStore) CreateOrUpdateMirror(ctx context.Context, opts *types.RepositoryMirror) error
- func (s *RepoStore) Find(ctx context.Context, id int64) (*types.Repository, error)
- func (s *RepoStore) FindByRef(ctx context.Context, repoRef string) (*types.Repository, error)
- func (s *RepoStore) FindByRefAndDeletedAt(ctx context.Context, repoRef string, deletedAt int64) (*types.Repository, error)
- func (s *RepoStore) GetMirror(ctx context.Context, id int64) (*types.RepositoryMirror, error)
- func (s *RepoStore) GetPublicAccess(ctx context.Context, id int64) (bool, error)
- func (s *RepoStore) GetSize(ctx context.Context, id int64) (int64, error)
- func (s *RepoStore) List(ctx context.Context, parentID int64, filter *types.RepoFilter) ([]*types.Repository, error)
- func (s *RepoStore) ListAllMirrorRepo(ctx context.Context) ([]*types.RepositoryMirror, error)
- func (s *RepoStore) ListAllWithoutParent(ctx context.Context, filter *types.RepoFilter) ([]*types.Repository, error)
- func (s *RepoStore) ListMulti(ctx context.Context, parentIDs []int64, opts *types.RepoFilter) ([]*types.Repository, error)
- func (s *RepoStore) ListSizeInfos(ctx context.Context) ([]*types.RepositorySizeInfo, error)
- func (s *RepoStore) Purge(ctx context.Context, id int64, deletedAt *int64) error
- func (s *RepoStore) Restore(ctx context.Context, repo *types.Repository, newIdentifier *string, ...) (*types.Repository, error)
- func (s *RepoStore) SetPublicAccess(ctx context.Context, id int64, isPublic bool) error
- func (s *RepoStore) SoftDelete(ctx context.Context, repo *types.Repository, deletedAt int64) error
- func (s *RepoStore) Update(ctx context.Context, repo *types.Repository) error
- func (s *RepoStore) UpdateMirror(ctx context.Context, opts *types.RepositoryMirror) error
- func (s *RepoStore) UpdateOptLock(ctx context.Context, repo *types.Repository, ...) (*types.Repository, error)
- func (s *RepoStore) UpdateSize(ctx context.Context, id int64, sizeInKiB 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, rule *types.Rule) error
- type SettingsStore
- func (s *SettingsStore) Find(ctx context.Context, scope enum.SettingsScope, scopeID int64, key string) (json.RawMessage, error)
- func (s *SettingsStore) FindMany(ctx context.Context, scope enum.SettingsScope, scopeID int64, keys ...string) (map[string]json.RawMessage, error)
- func (s *SettingsStore) Upsert(ctx context.Context, scope enum.SettingsScope, scopeID int64, key string, ...) error
- type SpacePathStore
- func (s *SpacePathStore) DeletePathsAndDescendandPaths(ctx context.Context, spaceID int64) error
- func (s *SpacePathStore) DeletePrimarySegment(ctx context.Context, spaceID int64) error
- func (s *SpacePathStore) FindByPath(ctx context.Context, path string) (*types.SpacePath, error)
- func (s *SpacePathStore) FindPrimaryBySpaceID(ctx context.Context, spaceID int64) (*types.SpacePath, error)
- func (s *SpacePathStore) InsertSegment(ctx context.Context, segment *types.SpacePathSegment) error
- type SpaceStore
- func (s *SpaceStore) Count(ctx context.Context, id int64, opts *types.SpaceFilter) (int64, error)
- func (s *SpaceStore) Create(ctx context.Context, space *types.Space) error
- func (s *SpaceStore) Find(ctx context.Context, id int64) (*types.Space, error)
- func (s *SpaceStore) FindByRef(ctx context.Context, spaceRef string) (*types.Space, error)
- func (s *SpaceStore) FindByRefAndDeletedAt(ctx context.Context, spaceRef string, deletedAt int64) (*types.Space, error)
- func (s *SpaceStore) FindByRefCaseInsensitive(ctx context.Context, spaceRef string) (*types.Space, error)
- func (s *SpaceStore) FindForUpdate(ctx context.Context, id int64) (*types.Space, error)
- func (s *SpaceStore) GetAncestorIDs(ctx context.Context, spaceID int64) ([]int64, error)
- func (s *SpaceStore) GetAncestors(ctx context.Context, spaceID int64) ([]*types.Space, error)
- func (s *SpaceStore) GetAncestorsData(ctx context.Context, spaceID int64) ([]types.SpaceParentData, error)
- func (s *SpaceStore) GetDescendantsData(ctx context.Context, spaceID int64) ([]types.SpaceParentData, error)
- func (s *SpaceStore) GetRootSpace(ctx context.Context, spaceID int64) (*types.Space, error)
- func (s *SpaceStore) List(ctx context.Context, id int64, opts *types.SpaceFilter) ([]*types.Space, error)
- func (s *SpaceStore) ListAll(ctx context.Context, opts *types.SpaceFilter) ([]*types.Space, error)
- func (s *SpaceStore) Purge(ctx context.Context, id int64, deletedAt *int64) error
- func (s *SpaceStore) Restore(ctx context.Context, space *types.Space, newIdentifier *string, ...) (*types.Space, error)
- func (s *SpaceStore) SoftDelete(ctx context.Context, space *types.Space, deletedAt int64) error
- func (s *SpaceStore) Update(ctx context.Context, space *types.Space) error
- func (s *SpaceStore) UpdateOptLock(ctx context.Context, space *types.Space, ...) (*types.Space, error)
- type TokenStore
- func (s *TokenStore) Count(ctx context.Context, principalID int64, tokenType enum.TokenType) (int64, error)
- func (s *TokenStore) Create(ctx context.Context, token *types.Token) error
- func (s *TokenStore) Delete(ctx context.Context, id int64) error
- func (s *TokenStore) DeleteExpiredBefore(ctx context.Context, before time.Time, tknTypes []enum.TokenType) (int64, error)
- func (s *TokenStore) Find(ctx context.Context, id int64) (*types.Token, error)
- func (s *TokenStore) FindByIdentifier(ctx context.Context, principalID int64, identifier string) (*types.Token, error)
- func (s *TokenStore) List(ctx context.Context, principalID int64, tokenType enum.TokenType) ([]*types.Token, error)
- type UserGroup
- type UserGroupStore
- func (s *UserGroupStore) Create(ctx context.Context, spaceID int64, userGroup *types.UserGroup) error
- func (s *UserGroupStore) CreateOrUpdate(ctx context.Context, spaceID int64, userGroup *types.UserGroup) error
- func (s *UserGroupStore) Find(ctx context.Context, id int64) (*types.UserGroup, error)
- func (s *UserGroupStore) FindByIdentifier(ctx context.Context, spaceID int64, identifier string) (*types.UserGroup, error)
- func (s *UserGroupStore) FindManyByIDs(ctx context.Context, ids []int64) ([]*types.UserGroup, error)
- func (s *UserGroupStore) FindManyByIdentifiersAndSpaceID(ctx context.Context, identifiers []string, spaceID int64) ([]*types.UserGroup, error)
- func (s *UserGroupStore) Map(ctx context.Context, ids []int64) (map[int64]*types.UserGroup, error)
- type UsergroupReviewerStore
- func (s *UsergroupReviewerStore) Create(ctx context.Context, v *types.UserGroupReviewer) error
- func (s *UsergroupReviewerStore) Delete(ctx context.Context, prID, userGroupReviewerID int64) error
- func (s *UsergroupReviewerStore) Find(ctx context.Context, prID, userGroupReviewerID int64) (*types.UserGroupReviewer, error)
- func (s *UsergroupReviewerStore) List(ctx context.Context, prID int64) ([]*types.UserGroupReviewer, error)
- type WebhookExecutionStore
- func (s *WebhookExecutionStore) CountForWebhook(ctx context.Context, webhookID int64) (int64, error)
- func (s *WebhookExecutionStore) Create(ctx context.Context, execution *types.WebhookExecution) error
- func (s *WebhookExecutionStore) DeleteOld(ctx context.Context, olderThan time.Time) (int64, error)
- func (s *WebhookExecutionStore) Find(ctx context.Context, id int64) (*types.WebhookExecution, error)
- func (s *WebhookExecutionStore) ListForTrigger(ctx context.Context, triggerID string) ([]*types.WebhookExecution, error)
- func (s *WebhookExecutionStore) ListForWebhook(ctx context.Context, webhookID int64, opts *types.WebhookExecutionFilter) ([]*types.WebhookExecution, error)
- type WebhookStore
- func (s *WebhookStore) Count(ctx context.Context, parents []types.WebhookParentInfo, ...) (int64, error)
- func (s *WebhookStore) Create(ctx context.Context, hook *types.Webhook) error
- func (s *WebhookStore) Delete(ctx context.Context, id int64) error
- func (s *WebhookStore) DeleteByIdentifier(ctx context.Context, parentType enum.WebhookParent, parentID int64, ...) error
- func (s *WebhookStore) Find(ctx context.Context, id int64) (*types.Webhook, error)
- func (s *WebhookStore) FindByIdentifier(ctx context.Context, parentType enum.WebhookParent, parentID int64, ...) (*types.Webhook, error)
- func (s *WebhookStore) List(ctx context.Context, parents []types.WebhookParentInfo, ...) ([]*types.Webhook, error)
- func (s *WebhookStore) Update(ctx context.Context, hook *types.Webhook) error
- func (s *WebhookStore) UpdateOptLock(ctx context.Context, hook *types.Webhook, ...) (*types.Webhook, error)
Constants ¶
const ( PostgresDriverName = "postgres" SqliteDriverName = "sqlite3" MysqlDriverName = "mysql" )
const (
ReturningClause = "RETURNING "
)
const TokenSelectByID = tokenSelectBase + `
WHERE token_id = $1
`
const TokenSelectByPrincipalIDAndIdentifier = tokenSelectBase + `
WHERE token_principal_id = $1 AND LOWER(token_uid) = $2
`
Variables ¶
var WireSet = wire.NewSet( ProvideDatabase, ProvidePrincipalStore, ProvideUserGroupStore, ProvideUserGroupReviewerStore, ProvidePrincipalInfoView, ProvideInfraProviderResourceView, ProvideSpacePathStore, ProvideSpaceStore, ProvideRepoStore, ProvideRuleStore, ProvideJobStore, ProvideExecutionStore, ProvidePipelineStore, ProvideStageStore, ProvideStepStore, ProvideAIStore, ProvideSecretStore, ProvideRepoGitInfoView, ProvideMembershipStore, ProvideTokenStore, ProvidePullReqStore, ProvidePullReqActivityStore, ProvideCodeCommentView, ProvidePullReqReviewStore, ProvidePullReqReviewerStore, ProvidePullReqFileViewStore, ProvideWebhookStore, ProvideWebhookExecutionStore, ProvideSettingsStore, ProvidePublicAccessStore, ProvideCheckStore, ProvideConnectorStore, ProvideTemplateStore, ProvideTriggerStore, ProvidePluginStore, ProvidePublicKeyStore, ProvideInfraProviderConfigStore, ProvideInfraProviderResourceStore, ProvideGitspaceConfigStore, ProvideGitspaceInstanceStore, ProvideGitspaceEventStore, ProvideLabelStore, ProvideLabelValueStore, ProvidePullReqLabelStore, ProvideInfraProviderTemplateStore, ProvideInfraProvisionedStore, )
WireSet provides a wire set for this package.
var WireSetOrm = wire.NewSet( ProvideGormDatabase, ProvideArtifactStore, )
WireSetOrm provides a wire orm set for this package.
Functions ¶
func EncodeToSQLXJSON ¶
EncodeToSQLXJSON accepts a generic parameter and returns a sqlx.JSONText object which is used to store arbitrary data in the DB. We absorb the error here as the value gets absorbed in sqlx.JSONText in case of UnsupportedValueError or UnsupportedTypeError.
func NewConnectorStore ¶
func NewConnectorStore(db *sqlx.DB, secretStore store.SecretStore) store.ConnectorStore
NewConnectorStore returns a new ConnectorStore. The secret store is used to resolve the secret references.
func NewExecutionStore ¶
func NewExecutionStore(db *sqlx.DB) store.ExecutionStore
NewExecutionStore returns a new ExecutionStore.
func NewGitspaceConfigStore ¶
func NewGitspaceConfigStore( db *sqlx.DB, pCache store.PrincipalInfoCache, rCache store.InfraProviderResourceCache, ) store.GitspaceConfigStore
NewGitspaceConfigStore returns a new GitspaceConfigStore.
func NewGitspaceEventStore ¶
func NewGitspaceEventStore(db *sqlx.DB) store.GitspaceEventStore
func NewGitspaceInstanceStore ¶
func NewGitspaceInstanceStore(db *sqlx.DB) store.GitspaceInstanceStore
NewGitspaceInstanceStore returns a new GitspaceInstanceStore.
func NewInfraProviderConfigStore ¶
func NewInfraProviderConfigStore(db *sqlx.DB) store.InfraProviderConfigStore
NewGitspaceConfigStore returns a new GitspaceConfigStore.
func NewInfraProviderResourceStore ¶
func NewInfraProviderResourceStore(db *sqlx.DB) store.InfraProviderResourceStore
NewGitspaceConfigStore returns a new GitspaceConfigStore.
func NewInfraProviderTemplateStore ¶
func NewInfraProviderTemplateStore(db *sqlx.DB) store.InfraProviderTemplateStore
func NewInfraProvisionedStore ¶
func NewInfraProvisionedStore(db *sqlx.DB) store.InfraProvisionedStore
func NewLabelStore ¶
func NewLabelStore( db *sqlx.DB, ) store.LabelStore
func NewLabelValueStore ¶
func NewLabelValueStore( db *sqlx.DB, ) store.LabelValueStore
func NewPipelineStore ¶
func NewPipelineStore(db *sqlx.DB) store.PipelineStore
NewPipelineStore returns a new PipelineStore.
func NewPluginStore ¶
func NewPluginStore(db *sqlx.DB) store.PluginStore
NewPluginStore returns a new PluginStore.
func NewPullReqLabelStore ¶
func NewPullReqLabelStore(db *sqlx.DB) store.PullReqLabelAssignmentStore
func NewSecretStore ¶
func NewSecretStore(db *sqlx.DB) store.SecretStore
NewSecretStore returns a new SecretStore.
func NewStageStore ¶
func NewStageStore(db *sqlx.DB) store.StageStore
NewStageStore returns a new StageStore.
func NewStepStore ¶
NewStepStore returns a new StepStore.
func NewTemplateStore ¶
func NewTemplateStore(db *sqlx.DB) store.TemplateStore
NewTemplateStore returns a new TemplateStore.
func NewTriggerStore ¶
func NewTriggerStore(db *sqlx.DB) store.TriggerStore
NewTriggerStore returns a new TriggerStore.
func PartialMatch ¶
PartialMatch builds a string pair that can be passed as a parameter to squirrel's Where() function for a SQL "LIKE" expression. Besides surrounding the input value with '%' wildcard characters for a partial match, this function also escapes the '_' and '%' metacharacters supported in SQL "LIKE" expressions. The "ESCAPE" clause isn't needed for Postgres, but is necessary for SQLite. It will be used only if '_' and '%' are present in the value string.
See: https://www.postgresql.org/docs/current/functions-matching.html#FUNCTIONS-LIKE https://www.sqlite.org/lang_expr.html#the_like_glob_regexp_match_and_extract_operators
func ProvideAIStore ¶
ProvideAIStore provides a ai store.
func ProvideArtifactStore ¶
func ProvideArtifactStore(orm *gorm.DB) store.ArtifactStore
ProvideArtifactStore provides a artifact store
func ProvideCheckStore ¶
func ProvideCheckStore( db *gorm.DB, principalInfoCache store.PrincipalInfoCache, ) store.CheckStore
ProvideCheckStore provides a status check result store.
func ProvideCodeCommentView ¶
func ProvideCodeCommentView(db *gorm.DB) store.CodeCommentView
ProvideCodeCommentView provides a code comment view.
func ProvideConnectorStore ¶
func ProvideConnectorStore(db *gorm.DB, secretStore store.SecretStore) store.ConnectorStore
ProvideConnectorStore provides a connector store.
func ProvideDatabase ¶
ProvideDatabase provides a database connection.
func ProvideExecutionStore ¶
func ProvideExecutionStore(db *gorm.DB) store.ExecutionStore
ProvideExecutionStore provides an execution store.
func ProvideGitspaceConfigStore ¶
func ProvideGitspaceConfigStore( db *gorm.DB, pCache store.PrincipalInfoCache, rCache store.InfraProviderResourceCache, ) store.GitspaceConfigStore
ProvideGitspaceConfigStore provides a gitspace config store.
func ProvideGitspaceEventStore ¶
func ProvideGitspaceEventStore(db *gorm.DB) store.GitspaceEventStore
ProvideGitspaceEventStore provides a gitspace event store.
func ProvideGitspaceInstanceStore ¶
func ProvideGitspaceInstanceStore(db *gorm.DB) store.GitspaceInstanceStore
ProvideGitspaceInstanceStore provides a gitspace instance store.
func ProvideGormDatabase ¶
func ProvideGormDatabase(ctx context.Context, dbConfig database.Config, config *types.Config, depend *sqlx.DB) (*gorm.DB, error)
ProvideGormDatabase provide a gorm database connection
func ProvideInfraProviderConfigStore ¶
func ProvideInfraProviderConfigStore(db *gorm.DB) store.InfraProviderConfigStore
ProvideInfraProviderConfigStore provides a infraprovider config store.
func ProvideInfraProviderResourceStore ¶
func ProvideInfraProviderResourceStore(db *gorm.DB) store.InfraProviderResourceStore
ProvideGitspaceInstanceStore provides a infraprovider resource store.
func ProvideInfraProviderResourceView ¶
func ProvideInfraProviderResourceView(db *gorm.DB) store.InfraProviderResourceView
ProvideInfraProviderResourceView provides a principal info store.
func ProvideInfraProviderTemplateStore ¶
func ProvideInfraProviderTemplateStore(db *gorm.DB) store.InfraProviderTemplateStore
ProvideInfraProviderTemplateStore provides a infraprovider template store.
func ProvideInfraProvisionedStore ¶
func ProvideInfraProvisionedStore(db *gorm.DB) store.InfraProvisionedStore
ProvideInfraProvisionedStore provides a provisioned infra store.
func ProvideJobStore ¶
ProvideJobStore provides a job store.
func ProvideLabelStore ¶
func ProvideLabelStore(db *gorm.DB) store.LabelStore
ProvideLabelStore provides a label store.
func ProvideLabelValueStore ¶
func ProvideLabelValueStore(db *gorm.DB) store.LabelValueStore
ProvideLabelValueStore provides a label value store.
func ProvideMembershipStore ¶
func ProvideMembershipStore( db *gorm.DB, principalInfoCache store.PrincipalInfoCache, spacePathStore store.SpacePathStore, spaceStore store.SpaceStore, ) store.MembershipStore
func ProvidePipelineStore ¶
func ProvidePipelineStore(db *gorm.DB) store.PipelineStore
ProvidePipelineStore provides a pipeline store.
func ProvidePluginStore ¶
func ProvidePluginStore(db *gorm.DB) store.PluginStore
ProvidePluginStore provides a plugin store.
func ProvidePrincipalInfoView ¶
func ProvidePrincipalInfoView(db *gorm.DB) store.PrincipalInfoView
ProvidePrincipalInfoView provides a principal info store.
func ProvidePrincipalStore ¶
func ProvidePrincipalStore(db *gorm.DB, uidTransformation store.PrincipalUIDTransformation) store.PrincipalStore
ProvidePrincipalStore provides a principal store.
func ProvidePublicAccessStore ¶
func ProvidePublicAccessStore(db *gorm.DB) store.PublicAccessStore
ProvidePublicAccessStore provides a public access store.
func ProvidePublicKeyStore ¶
func ProvidePublicKeyStore(db *gorm.DB) store.PublicKeyStore
ProvidePublicKeyStore provides a public key store.
func ProvidePullReqActivityStore ¶
func ProvidePullReqActivityStore( db *gorm.DB, principalInfoCache store.PrincipalInfoCache, ) store.PullReqActivityStore
ProvidePullReqActivityStore provides a pull request activity store.
func ProvidePullReqFileViewStore ¶
func ProvidePullReqFileViewStore(db *gorm.DB) store.PullReqFileViewStore
ProvidePullReqFileViewStore provides a pull request file view store.
func ProvidePullReqLabelStore ¶
func ProvidePullReqLabelStore(db *gorm.DB) store.PullReqLabelAssignmentStore
ProvideLabelValueStore provides a label value store.
func ProvidePullReqReviewStore ¶
func ProvidePullReqReviewStore(db *gorm.DB) store.PullReqReviewStore
ProvidePullReqReviewStore provides a pull request review store.
func ProvidePullReqReviewerStore ¶
func ProvidePullReqReviewerStore( db *gorm.DB, principalInfoCache store.PrincipalInfoCache, ) store.PullReqReviewerStore
ProvidePullReqReviewerStore provides a pull request reviewer store.
func ProvidePullReqStore ¶
func ProvidePullReqStore( db *gorm.DB, principalInfoCache store.PrincipalInfoCache, ) store.PullReqStore
ProvidePullReqStore provides a pull request store.
func ProvideRepoGitInfoView ¶
func ProvideRepoGitInfoView(db *gorm.DB) store.RepoGitInfoView
ProvideRepoGitInfoView provides a repo git UID view.
func ProvideRepoStore ¶
func ProvideRepoStore( db *gorm.DB, spacePathCache store.SpacePathCache, spacePathStore store.SpacePathStore, spaceStore store.SpaceStore, ) store.RepoStore
ProvideRepoStore provides a repo store.
func ProvideRuleStore ¶
ProvideRuleStore provides a rule store.
func ProvideSecretStore ¶
func ProvideSecretStore(db *gorm.DB) store.SecretStore
ProvideSecretStore provides a secret store.
func ProvideSettingsStore ¶
func ProvideSettingsStore(db *gorm.DB) store.SettingsStore
ProvideSettingsStore provides a settings store.
func ProvideSpacePathStore ¶
func ProvideSpacePathStore( db *gorm.DB, spacePathTransformation store.SpacePathTransformation, ) store.SpacePathStore
ProvideSpacePathStore provides a space path store.
func ProvideSpaceStore ¶
func ProvideSpaceStore( db *gorm.DB, spacePathCache store.SpacePathCache, spacePathStore store.SpacePathStore, ) store.SpaceStore
ProvideSpaceStore provides a space store.
func ProvideStageStore ¶
func ProvideStageStore(db *gorm.DB) store.StageStore
ProvideStageStore provides a stage store.
func ProvideStepStore ¶
ProvideStepStore provides a step store.
func ProvideTemplateStore ¶
func ProvideTemplateStore(db *gorm.DB) store.TemplateStore
ProvideTemplateStore provides a template store.
func ProvideTokenStore ¶
func ProvideTokenStore(db *gorm.DB) store.TokenStore
ProvideTokenStore provides a token store.
func ProvideTriggerStore ¶
func ProvideTriggerStore(db *gorm.DB) store.TriggerStore
ProvideTriggerStore provides a trigger store.
func ProvideUserGroupReviewerStore ¶
func ProvideUserGroupReviewerStore( db *gorm.DB, pInfoCache store.PrincipalInfoCache, userGroupStore store.UserGroupStore, ) store.UserGroupReviewersStore
ProvideUserGroupReviewerStore provides a usergroup reviewer store.
func ProvideUserGroupStore ¶
func ProvideUserGroupStore(db *gorm.DB) store.UserGroupStore
ProvideUserGroupStore provides a principal store.
func ProvideWebhookExecutionStore ¶
func ProvideWebhookExecutionStore(db *gorm.DB) store.WebhookExecutionStore
ProvideWebhookExecutionStore provides a webhook execution store.
func ProvideWebhookStore ¶
func ProvideWebhookStore(db *gorm.DB) store.WebhookStore
ProvideWebhookStore provides a webhook store.
Types ¶
type AIStore ¶
type AIStore struct {
// contains filtered or unexported fields
}
AIStore implements a store.AIStore backed by a relational database.
func (AIStore) LastRecord ¶
type CheckStore ¶
type CheckStore struct {
// contains filtered or unexported fields
}
CheckStore implements store.CheckStore backed by a relational database.
func NewCheckStore ¶
func NewCheckStore( db *sqlx.DB, pCache store.PrincipalInfoCache, ) *CheckStore
NewCheckStore returns a new CheckStore.
func (*CheckStore) Count ¶
func (s *CheckStore) 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 (*CheckStore) FindByIdentifier ¶
func (s *CheckStore) FindByIdentifier( ctx context.Context, repoID int64, commitSHA string, identifier string, ) (types.Check, error)
FindByIdentifier returns status check result for given unique key.
func (*CheckStore) List ¶
func (s *CheckStore) 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 (*CheckStore) ListRecent ¶
func (s *CheckStore) ListRecent(ctx context.Context, repoID int64, opts types.CheckRecentOptions, ) ([]string, error)
ListRecent returns a list of recently executed status checks in a repository.
func (*CheckStore) ListResults ¶
func (s *CheckStore) 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 (*CheckStore) ResultSummary ¶
func (s *CheckStore) 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 CodeCommentView ¶
type CodeCommentView struct {
// contains filtered or unexported fields
}
CodeCommentView implements store.CodeCommentView backed by a relational database.
func NewCodeCommentView ¶
func NewCodeCommentView(db *sqlx.DB) *CodeCommentView
NewCodeCommentView returns a new CodeCommentView.
func (*CodeCommentView) ListNotAtMergeBaseSHA ¶
func (s *CodeCommentView) ListNotAtMergeBaseSHA(ctx context.Context, prID int64, mergeBaseSHA string, ) ([]*types.CodeComment, error)
ListNotAtMergeBaseSHA lists all code comments not already at the provided merge base SHA.
func (*CodeCommentView) ListNotAtSourceSHA ¶
func (s *CodeCommentView) ListNotAtSourceSHA(ctx context.Context, prID int64, sourceSHA string, ) ([]*types.CodeComment, error)
ListNotAtSourceSHA lists all code comments not already at the provided source SHA.
func (*CodeCommentView) UpdateAll ¶
func (s *CodeCommentView) UpdateAll(ctx context.Context, codeComments []*types.CodeComment) error
UpdateAll updates all code comments provided in the slice.
type InfraProviderResourceView ¶
type InfraProviderResourceView struct {
// contains filtered or unexported fields
}
func NewInfraProviderResourceView ¶
func NewInfraProviderResourceView(db *sqlx.DB) *InfraProviderResourceView
NewInfraProviderResourceView returns a new InfraProviderResourceView. It's used by the infraprovider resource cache.
func (InfraProviderResourceView) Find ¶
func (i InfraProviderResourceView) Find(ctx context.Context, id int64) (*types.InfraProviderResource, error)
func (InfraProviderResourceView) FindMany ¶
func (i InfraProviderResourceView) FindMany(ctx context.Context, ids []int64) ([]*types.InfraProviderResource, error)
type JobStore ¶
type JobStore struct {
// contains filtered or unexported fields
}
func NewJobStore ¶
func (*JobStore) CountRunning ¶
CountRunning returns number of jobs that are currently being run.
func (*JobStore) DeleteByGroupID ¶
DeleteByGroupID deletes all jobs for a group id.
func (*JobStore) DeleteByUID ¶
DeleteByID deletes a job by its unique identifier.
func (*JobStore) DeleteOld ¶
DeleteOld removes non-recurring jobs that have finished execution or have failed.
func (*JobStore) ListByGroupID ¶
ListByGroupID fetches all jobs for a group id.
func (*JobStore) ListDeadlineExceeded ¶
ListDeadlineExceeded returns a list of jobs that have exceeded their execution deadline.
func (*JobStore) ListReady ¶
ListReady returns a list of jobs that are ready for execution: The jobs with state="scheduled" and scheduled time in the past.
func (*JobStore) NextScheduledTime ¶
NextScheduledTime returns a scheduled time of the next ready job or zero time if no such job exists.
func (*JobStore) UpdateDefinition ¶
UpdateDefinition is used to update a job definition.
func (*JobStore) UpdateExecution ¶
UpdateExecution is used to update a job before and after execution.
func (*JobStore) UpdateProgress ¶
type MembershipStore ¶
type MembershipStore struct {
// contains filtered or unexported fields
}
MembershipStore implements store.MembershipStore backed by a relational database.
func NewMembershipStore ¶
func NewMembershipStore( db *sqlx.DB, pCache store.PrincipalInfoCache, spacePathStore store.SpacePathStore, spaceStore store.SpaceStore, ) *MembershipStore
NewMembershipStore returns a new MembershipStore.
func (*MembershipStore) CountSpaces ¶
func (s *MembershipStore) CountSpaces(ctx context.Context, userID int64, filter types.MembershipSpaceFilter, ) (int64, error)
func (*MembershipStore) CountUsers ¶
func (s *MembershipStore) CountUsers(ctx context.Context, spaceID int64, filter types.MembershipUserFilter, ) (int64, error)
CountUsers returns a number of users memberships that matches the provided filter.
func (*MembershipStore) Create ¶
func (s *MembershipStore) Create(ctx context.Context, membership *types.Membership) error
Create creates a new membership.
func (*MembershipStore) Delete ¶
func (s *MembershipStore) Delete(ctx context.Context, key types.MembershipKey) error
Delete deletes the membership.
func (*MembershipStore) Find ¶
func (s *MembershipStore) Find(ctx context.Context, key types.MembershipKey) (*types.Membership, error)
Find finds the membership by space id and principal id.
func (*MembershipStore) FindUser ¶
func (s *MembershipStore) FindUser(ctx context.Context, key types.MembershipKey) (*types.MembershipUser, error)
func (*MembershipStore) ListSpaces ¶
func (s *MembershipStore) ListSpaces(ctx context.Context, userID int64, filter types.MembershipSpaceFilter, ) ([]types.MembershipSpace, error)
ListSpaces returns a list of spaces in which the provided user is a member.
func (*MembershipStore) ListUserSpaces ¶
func (*MembershipStore) ListUsers ¶
func (s *MembershipStore) ListUsers(ctx context.Context, spaceID int64, filter types.MembershipUserFilter, ) ([]types.MembershipUser, error)
ListUsers returns a list of memberships for a space or a user.
func (*MembershipStore) Update ¶
func (s *MembershipStore) Update(ctx context.Context, membership *types.Membership) error
Update updates the role of a member of a space.
type PrincipalInfoView ¶
type PrincipalInfoView struct {
// contains filtered or unexported fields
}
func NewPrincipalInfoView ¶
func NewPrincipalInfoView(db *sqlx.DB) *PrincipalInfoView
NewPrincipalInfoView returns a new PrincipalInfoView. It's used by the principal info cache.
func (*PrincipalInfoView) Find ¶
func (s *PrincipalInfoView) Find(ctx context.Context, id int64) (*types.PrincipalInfo, error)
Find returns a single principal info object by id from the `principals` database table.
func (*PrincipalInfoView) FindMany ¶
func (s *PrincipalInfoView) FindMany(ctx context.Context, ids []int64) ([]*types.PrincipalInfo, error)
FindMany returns a several principal info objects by id from the `principals` database table.
type PrincipalStore ¶
type PrincipalStore struct {
// contains filtered or unexported fields
}
PrincipalStore implements a PrincipalStore backed by a relational database.
func NewPrincipalStore ¶
func NewPrincipalStore(db *sqlx.DB, uidTransformation store.PrincipalUIDTransformation) *PrincipalStore
NewPrincipalStore returns a new PrincipalStore.
func (*PrincipalStore) CountServiceAccounts ¶
func (s *PrincipalStore) CountServiceAccounts(ctx context.Context, parentType enum.ParentResourceType, parentID int64) (int64, error)
CountServiceAccounts returns a count of service accounts for a specific parent.
func (*PrincipalStore) CountServices ¶
func (s *PrincipalStore) CountServices(ctx context.Context) (int64, error)
CountServices returns a count of service for a specific parent.
func (*PrincipalStore) CountUsers ¶
func (s *PrincipalStore) CountUsers(ctx context.Context, opts *types.UserFilter) (int64, error)
CountUsers returns a count of users matching the given filter.
func (*PrincipalStore) CreateService ¶
CreateService saves the service.
func (*PrincipalStore) CreateServiceAccount ¶
func (s *PrincipalStore) CreateServiceAccount(ctx context.Context, sa *types.ServiceAccount) error
CreateServiceAccount saves the service account.
func (*PrincipalStore) CreateUser ¶
CreateUser saves the user details.
func (*PrincipalStore) DeleteService ¶
func (s *PrincipalStore) DeleteService(ctx context.Context, id int64) error
DeleteService deletes the service.
func (*PrincipalStore) DeleteServiceAccount ¶
func (s *PrincipalStore) DeleteServiceAccount(ctx context.Context, id int64) error
DeleteServiceAccount deletes the service account.
func (*PrincipalStore) DeleteUser ¶
func (s *PrincipalStore) DeleteUser(ctx context.Context, id int64) error
DeleteUser deletes the user.
func (*PrincipalStore) FindByEmail ¶
FindByEmail finds the principal by email.
func (*PrincipalStore) FindManyByUID ¶
func (s *PrincipalStore) FindManyByUID(ctx context.Context, uids []string) ([]*types.Principal, error)
FindManyByUID returns all principals found for the provided UIDs. If a UID isn't found, it's not returned in the list.
func (*PrincipalStore) FindService ¶
FindService finds the service by id.
func (*PrincipalStore) FindServiceAccount ¶
func (s *PrincipalStore) FindServiceAccount(ctx context.Context, id int64) (*types.ServiceAccount, error)
FindServiceAccount finds the service account by id.
func (*PrincipalStore) FindServiceAccountByUID ¶
func (s *PrincipalStore) FindServiceAccountByUID(ctx context.Context, uid string) (*types.ServiceAccount, error)
FindServiceAccountByUID finds the service account by uid.
func (*PrincipalStore) FindServiceByUID ¶
FindServiceByUID finds the service by uid.
func (*PrincipalStore) FindUserByEmail ¶
FindUserByEmail finds the user by email.
func (*PrincipalStore) FindUserByUID ¶
FindUserByUID finds the user by uid.
func (*PrincipalStore) List ¶
func (s *PrincipalStore) List(ctx context.Context, opts *types.PrincipalFilter) ([]*types.Principal, error)
List lists the principals matching the provided filter.
func (*PrincipalStore) ListServiceAccounts ¶
func (s *PrincipalStore) ListServiceAccounts(ctx context.Context, parentType enum.ParentResourceType, parentID int64) ([]*types.ServiceAccount, error)
ListServiceAccounts returns a list of service accounts for a specific parent.
func (*PrincipalStore) ListServices ¶
ListServices returns a list of service for a specific parent.
func (*PrincipalStore) ListUsers ¶
func (s *PrincipalStore) ListUsers(ctx context.Context, opts *types.UserFilter) ([]*types.User, error)
ListUsers returns a list of users.
func (*PrincipalStore) UpdateService ¶
UpdateService updates the service.
func (*PrincipalStore) UpdateServiceAccount ¶
func (s *PrincipalStore) UpdateServiceAccount(ctx context.Context, sa *types.ServiceAccount) error
UpdateServiceAccount updates the service account details.
func (*PrincipalStore) UpdateUser ¶
UpdateUser updates an existing user.
type PublicAccessStore ¶
type PublicAccessStore struct {
// contains filtered or unexported fields
}
PublicAccessStore implements store.PublicAccessStore backed by a relational database.
func NewPublicAccessStore ¶
func NewPublicAccessStore(db *sqlx.DB) *PublicAccessStore
NewPublicAccessStore returns a new PublicAccessStore.
func (*PublicAccessStore) Create ¶
func (p *PublicAccessStore) Create( ctx context.Context, typ enum.PublicResourceType, id int64, ) error
func (*PublicAccessStore) Delete ¶
func (p *PublicAccessStore) Delete( ctx context.Context, typ enum.PublicResourceType, id int64, ) error
func (*PublicAccessStore) Find ¶
func (p *PublicAccessStore) Find( ctx context.Context, typ enum.PublicResourceType, id int64, ) (bool, error)
type PublicKeyStore ¶
type PublicKeyStore struct {
// contains filtered or unexported fields
}
PublicKeyStore implements a store.PublicKeyStore backed by a relational database.
func NewPublicKeyStore ¶
func NewPublicKeyStore(db *sqlx.DB) PublicKeyStore
NewPublicKeyStore returns a new PublicKeyStore.
func (PublicKeyStore) Count ¶
func (s PublicKeyStore) Count( ctx context.Context, principalID int64, filter *types.PublicKeyFilter, ) (int, error)
func (PublicKeyStore) DeleteByIdentifier ¶
func (s PublicKeyStore) DeleteByIdentifier(ctx context.Context, principalID int64, identifier string) error
DeleteByIdentifier deletes a public key.
func (PublicKeyStore) FindByIdentifier ¶
func (s PublicKeyStore) FindByIdentifier( ctx context.Context, principalID int64, identifier string, ) (*types.PublicKey, error)
FindByIdentifier returns a public key given a principal ID and an identifier.
func (PublicKeyStore) List ¶
func (s PublicKeyStore) List( ctx context.Context, principalID int64, filter *types.PublicKeyFilter, ) ([]types.PublicKey, error)
List returns the public keys for the principal.
func (PublicKeyStore) ListByFingerprint ¶
func (s PublicKeyStore) ListByFingerprint( ctx context.Context, fingerprint string, ) ([]types.PublicKey, error)
ListByFingerprint returns public keys given a fingerprint and key usage.
func (PublicKeyStore) MarkAsVerified ¶
MarkAsVerified updates the public key to mark it as verified.
type PullReqActivityStore ¶
type PullReqActivityStore struct {
// contains filtered or unexported fields
}
PullReqActivityStore implements store.PullReqActivityStore backed by a relational database.
func NewPullReqActivityStore ¶
func NewPullReqActivityStore( db *sqlx.DB, pCache store.PrincipalInfoCache, ) *PullReqActivityStore
NewPullReqActivityStore returns a new PullReqJournalStore.
func (*PullReqActivityStore) Count ¶
func (s *PullReqActivityStore) Count(ctx context.Context, prID int64, opts *types.PullReqActivityFilter, ) (int64, error)
Count of pull requests for a repo.
func (*PullReqActivityStore) CountUnresolved ¶
func (*PullReqActivityStore) Create ¶
func (s *PullReqActivityStore) Create(ctx context.Context, act *types.PullReqActivity) error
Create creates a new pull request.
func (*PullReqActivityStore) CreateWithPayload ¶
func (s *PullReqActivityStore) CreateWithPayload(ctx context.Context, pr *types.PullReq, principalID int64, payload types.PullReqActivityPayload, metadata *types.PullReqActivityMetadata, ) (*types.PullReqActivity, error)
func (*PullReqActivityStore) Find ¶
func (s *PullReqActivityStore) Find(ctx context.Context, id int64) (*types.PullReqActivity, error)
Find finds the pull request activity by id.
func (*PullReqActivityStore) List ¶
func (s *PullReqActivityStore) List(ctx context.Context, prID int64, filter *types.PullReqActivityFilter, ) ([]*types.PullReqActivity, error)
List returns a list of pull request activities for a PR.
func (*PullReqActivityStore) ListAuthorIDs ¶
func (s *PullReqActivityStore) ListAuthorIDs(ctx context.Context, prID int64, order int64) ([]int64, error)
ListAuthorIDs returns a list of pull request activity author ids in a thread for a PR.
func (*PullReqActivityStore) Update ¶
func (s *PullReqActivityStore) Update(ctx context.Context, act *types.PullReqActivity) error
Update updates the pull request.
func (*PullReqActivityStore) UpdateOptLock ¶
func (s *PullReqActivityStore) UpdateOptLock(ctx context.Context, act *types.PullReqActivity, mutateFn func(act *types.PullReqActivity) error, ) (*types.PullReqActivity, error)
UpdateOptLock updates the pull request using the optimistic locking mechanism.
type PullReqFileViewStore ¶
type PullReqFileViewStore struct {
// contains filtered or unexported fields
}
PullReqFileViewStore implements store.PullReqFileViewStore backed by a relational database.
func NewPullReqFileViewStore ¶
func NewPullReqFileViewStore( db *sqlx.DB, ) *PullReqFileViewStore
NewPullReqFileViewStore returns a new PullReqFileViewStore.
func (*PullReqFileViewStore) DeleteByFileForPrincipal ¶
func (s *PullReqFileViewStore) DeleteByFileForPrincipal( ctx context.Context, prID int64, principalID int64, filePath string, ) error
DeleteByFileForPrincipal deletes the entry for the specified PR, principal, and file.
func (*PullReqFileViewStore) List ¶
func (s *PullReqFileViewStore) List( ctx context.Context, prID int64, principalID int64, ) ([]*types.PullReqFileView, error)
List lists all files marked as viewed by the user for the specified PR.
func (*PullReqFileViewStore) MarkObsolete ¶
func (s *PullReqFileViewStore) MarkObsolete(ctx context.Context, prID int64, filePaths []string) error
MarkObsolete updates all entries of the files as obsolete for the PR.
func (*PullReqFileViewStore) Upsert ¶
func (s *PullReqFileViewStore) Upsert(ctx context.Context, view *types.PullReqFileView) error
Upsert inserts or updates the latest viewed sha for a file in a PR.
type PullReqReviewStore ¶
type PullReqReviewStore struct {
// contains filtered or unexported fields
}
PullReqReviewStore implements store.PullReqReviewStore backed by a relational database.
func NewPullReqReviewStore ¶
func NewPullReqReviewStore(db *sqlx.DB) *PullReqReviewStore
NewPullReqReviewStore returns a new PullReqReviewStore.
func (*PullReqReviewStore) Create ¶
func (s *PullReqReviewStore) Create(ctx context.Context, v *types.PullReqReview) error
Create creates a new pull request.
func (*PullReqReviewStore) Find ¶
func (s *PullReqReviewStore) Find(ctx context.Context, id int64) (*types.PullReqReview, error)
Find finds the pull request activity by id.
type PullReqReviewerStore ¶
type PullReqReviewerStore struct {
// contains filtered or unexported fields
}
PullReqReviewerStore implements store.PullReqReviewerStore backed by a relational database.
func NewPullReqReviewerStore ¶
func NewPullReqReviewerStore(db *sqlx.DB, pCache store.PrincipalInfoCache) *PullReqReviewerStore
NewPullReqReviewerStore returns a new PullReqReviewerStore.
func (*PullReqReviewerStore) Create ¶
func (s *PullReqReviewerStore) Create(ctx context.Context, v *types.PullReqReviewer) error
Create creates a new pull request reviewer.
func (*PullReqReviewerStore) Delete ¶
func (s *PullReqReviewerStore) Delete(ctx context.Context, prID, reviewerID int64) error
Delete deletes the pull request reviewer.
func (*PullReqReviewerStore) Find ¶
func (s *PullReqReviewerStore) Find(ctx context.Context, prID, principalID int64) (*types.PullReqReviewer, error)
Find finds the pull request reviewer by pull request id and principal id.
func (*PullReqReviewerStore) List ¶
func (s *PullReqReviewerStore) List(ctx context.Context, prID int64) ([]*types.PullReqReviewer, error)
List returns a list of pull reviewers for a pull request.
func (*PullReqReviewerStore) Update ¶
func (s *PullReqReviewerStore) Update(ctx context.Context, v *types.PullReqReviewer) error
Update updates the pull request reviewer.
type PullReqStore ¶
type PullReqStore struct {
// contains filtered or unexported fields
}
PullReqStore implements store.PullReqStore backed by a relational database.
func NewPullReqStore ¶
func NewPullReqStore(db *sqlx.DB, pCache store.PrincipalInfoCache) *PullReqStore
NewPullReqStore returns a new PullReqStore.
func (*PullReqStore) Count ¶
func (s *PullReqStore) Count(ctx context.Context, opts *types.PullReqFilter) (int64, error)
Count of pull requests for a repo.
func (*PullReqStore) Delete ¶
func (s *PullReqStore) Delete(ctx context.Context, id int64) error
Delete the pull request.
func (*PullReqStore) FindByNumber ¶
func (s *PullReqStore) FindByNumber(ctx context.Context, repoID, number int64) (*types.PullReq, error)
FindByNumber finds the pull request by repo ID and pull request number.
func (*PullReqStore) FindByNumberWithLock ¶
func (s *PullReqStore) FindByNumberWithLock( ctx context.Context, repoID, number int64, ) (*types.PullReq, error)
FindByNumberWithLock finds the pull request by repo ID and pull request number and locks the pull request for the duration of the transaction.
func (*PullReqStore) GetUnmergedPullRequest ¶
func (*PullReqStore) List ¶
func (s *PullReqStore) List(ctx context.Context, opts *types.PullReqFilter) ([]*types.PullReq, error)
List returns a list of pull requests for a repo.
func (*PullReqStore) ListOpenByBranchName ¶
func (*PullReqStore) ResetMergeCheckStatus ¶
func (s *PullReqStore) ResetMergeCheckStatus( ctx context.Context, targetRepo int64, targetBranch string, ) error
ResetMergeCheckStatus resets the pull request's mergeability status to unchecked for all pr which target branch points to targetBranch.
func (*PullReqStore) Stream ¶
func (s *PullReqStore) Stream(ctx context.Context, opts *types.PullReqFilter) (<-chan *types.PullReq, <-chan error)
Stream returns a list of pull requests for a repo.
func (*PullReqStore) SummaryCount ¶
func (s *PullReqStore) SummaryCount(ctx context.Context, opts *types.PullReqSummaryFilter) (*types.PullReqSummary, error)
func (*PullReqStore) UpdateActivitySeq ¶
func (s *PullReqStore) UpdateActivitySeq(ctx context.Context, pr *types.PullReq) (*types.PullReq, error)
UpdateActivitySeq updates the pull request's activity sequence.
type RepoGitInfoView ¶
type RepoGitInfoView struct {
// contains filtered or unexported fields
}
func NewRepoGitInfoView ¶
func NewRepoGitInfoView(db *sqlx.DB) *RepoGitInfoView
NewRepoGitInfoView returns a new RepoGitInfoView. It's used by the repository git UID cache.
func (*RepoGitInfoView) Find ¶
func (s *RepoGitInfoView) Find(ctx context.Context, id int64) (*types.RepositoryGitInfo, error)
type RepoStore ¶
type RepoStore struct {
// contains filtered or unexported fields
}
RepoStore implements a store.RepoStore backed by a relational database.
func NewRepoStore ¶
func NewRepoStore( db *sqlx.DB, spacePathCache store.SpacePathCache, spacePathStore store.SpacePathStore, spaceStore store.SpaceStore, ) *RepoStore
NewRepoStore returns a new RepoStore.
func (*RepoStore) Count ¶
func (s *RepoStore) 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 (*RepoStore) CountAllWithoutParent ¶
func (*RepoStore) CountByRootSpaces ¶
CountByRootSpaces counts total number of repositories grouped by root spaces.
func (*RepoStore) CountMulti ¶
func (*RepoStore) CreateOrUpdateMirror ¶
func (*RepoStore) FindByRef ¶
FindByRef finds the repo using the repoRef as either the id or the repo path.
func (*RepoStore) FindByRefAndDeletedAt ¶
func (s *RepoStore) FindByRefAndDeletedAt( ctx context.Context, repoRef string, deletedAt int64, ) (*types.Repository, error)
FindByRefAndDeletedAt finds the repo using the repoRef and deleted timestamp.
func (*RepoStore) GetPublicAccess ¶
func (*RepoStore) List ¶
func (s *RepoStore) 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 (*RepoStore) ListAllMirrorRepo ¶
func (*RepoStore) ListAllWithoutParent ¶
func (s *RepoStore) ListAllWithoutParent(ctx context.Context, filter *types.RepoFilter) ([]*types.Repository, error)
func (*RepoStore) ListMulti ¶
func (s *RepoStore) ListMulti(ctx context.Context, parentIDs []int64, opts *types.RepoFilter) ([]*types.Repository, error)
func (*RepoStore) ListSizeInfos ¶
func (*RepoStore) Restore ¶
func (s *RepoStore) Restore( ctx context.Context, repo *types.Repository, newIdentifier *string, newParentID *int64, ) (*types.Repository, error)
Restore restores a deleted repo.
func (*RepoStore) SetPublicAccess ¶
func (*RepoStore) SoftDelete ¶
SoftDelete deletes a repo softly by setting the deleted timestamp.
func (*RepoStore) UpdateMirror ¶
func (*RepoStore) UpdateOptLock ¶
func (s *RepoStore) 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 NewRuleStore ¶
func NewRuleStore( db *sqlx.DB, pCache store.PrincipalInfoCache, ) *RuleStore
NewRuleStore 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 build in 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.
type SettingsStore ¶
type SettingsStore struct {
// contains filtered or unexported fields
}
SettingsStore implements store.SettingsStore backed by a relational database.
func NewSettingsStore ¶
func NewSettingsStore(db *sqlx.DB) *SettingsStore
NewSettingsStore returns a new SettingsStore.
func (*SettingsStore) Find ¶
func (s *SettingsStore) Find( ctx context.Context, scope enum.SettingsScope, scopeID int64, key string, ) (json.RawMessage, error)
func (*SettingsStore) FindMany ¶
func (s *SettingsStore) FindMany( ctx context.Context, scope enum.SettingsScope, scopeID int64, keys ...string, ) (map[string]json.RawMessage, error)
func (*SettingsStore) Upsert ¶
func (s *SettingsStore) Upsert(ctx context.Context, scope enum.SettingsScope, scopeID int64, key string, value json.RawMessage, ) error
type SpacePathStore ¶
type SpacePathStore struct {
// contains filtered or unexported fields
}
SpacePathStore implements a store.SpacePathStore backed by a relational database.
func NewSpacePathStore ¶
func NewSpacePathStore( db *sqlx.DB, pathTransformation store.SpacePathTransformation, ) *SpacePathStore
NewSpacePathStore returns a new SpacePathStore.
func (*SpacePathStore) DeletePathsAndDescendandPaths ¶
func (s *SpacePathStore) DeletePathsAndDescendandPaths(ctx context.Context, spaceID int64) error
DeletePathsAndDescendandPaths deletes all space paths reachable from spaceID including itself.
func (*SpacePathStore) DeletePrimarySegment ¶
func (s *SpacePathStore) DeletePrimarySegment(ctx context.Context, spaceID int64) error
DeletePrimarySegment deletes the primary segment of the space.
func (*SpacePathStore) FindByPath ¶
func (*SpacePathStore) FindPrimaryBySpaceID ¶
func (*SpacePathStore) InsertSegment ¶
func (s *SpacePathStore) InsertSegment(ctx context.Context, segment *types.SpacePathSegment) error
InsertSegment inserts a space path segment to the table - returns the full path.
type SpaceStore ¶
type SpaceStore struct {
// contains filtered or unexported fields
}
SpaceStore implements a SpaceStore backed by a relational database.
func NewSpaceStore ¶
func NewSpaceStore( db *sqlx.DB, spacePathCache store.SpacePathCache, spacePathStore store.SpacePathStore, ) *SpaceStore
NewSpaceStore returns a new SpaceStore.
func (*SpaceStore) Count ¶
func (s *SpaceStore) Count(ctx context.Context, id int64, opts *types.SpaceFilter) (int64, error)
Count the child spaces of a space.
func (*SpaceStore) FindByRef ¶
FindByRef finds the space using the spaceRef as either the id or the space path.
func (*SpaceStore) FindByRefAndDeletedAt ¶
func (s *SpaceStore) FindByRefAndDeletedAt( ctx context.Context, spaceRef string, deletedAt int64, ) (*types.Space, error)
FindByRefAndDeletedAt finds the space using the spaceRef as either the id or the space path and deleted timestamp.
func (*SpaceStore) FindByRefCaseInsensitive ¶
func (s *SpaceStore) FindByRefCaseInsensitive(ctx context.Context, spaceRef string) (*types.Space, error)
FindByRefCaseInsensitive finds the space using the spaceRef.
func (*SpaceStore) FindForUpdate ¶
FindForUpdate finds the space and locks it for an update (should be called in a tx).
func (*SpaceStore) GetAncestorIDs ¶
GetAncestorIDs returns a list of all space IDs along the recursive path to the root space.
func (*SpaceStore) GetAncestors ¶
func (*SpaceStore) GetAncestorsData ¶
func (s *SpaceStore) GetAncestorsData(ctx context.Context, spaceID int64) ([]types.SpaceParentData, error)
GetAncestorsData returns a list of space parent data for spaces that are ancestors of the space.
func (*SpaceStore) GetDescendantsData ¶
func (s *SpaceStore) GetDescendantsData(ctx context.Context, spaceID int64) ([]types.SpaceParentData, error)
GetDescendantsData returns a list of space parent data for spaces that are descendants of the space.
func (*SpaceStore) GetRootSpace ¶
GetRootSpace returns a space where space_parent_id is NULL.
func (*SpaceStore) List ¶
func (s *SpaceStore) List( ctx context.Context, id int64, opts *types.SpaceFilter, ) ([]*types.Space, error)
List returns a list of spaces under the parent space.
func (*SpaceStore) ListAll ¶
func (s *SpaceStore) ListAll(ctx context.Context, opts *types.SpaceFilter) ([]*types.Space, error)
func (*SpaceStore) Restore ¶
func (s *SpaceStore) Restore( ctx context.Context, space *types.Space, newIdentifier *string, newParentID *int64, ) (*types.Space, error)
Restore restores a soft deleted space.
func (*SpaceStore) SoftDelete ¶
SoftDelete deletes a space softly.
type TokenStore ¶
type TokenStore struct {
// contains filtered or unexported fields
}
TokenStore implements a TokenStore backed by a relational database.
func NewTokenStore ¶
func NewTokenStore(db *sqlx.DB) *TokenStore
NewTokenStore returns a new TokenStore.
func (*TokenStore) Count ¶
func (s *TokenStore) Count(ctx context.Context, principalID int64, tokenType enum.TokenType) (int64, error)
Count returns a count of tokens of a specifc type for a specific principal.
func (*TokenStore) Delete ¶
func (s *TokenStore) Delete(ctx context.Context, id int64) error
Delete deletes the token with the given id.
func (*TokenStore) DeleteExpiredBefore ¶
func (s *TokenStore) DeleteExpiredBefore( ctx context.Context, before time.Time, tknTypes []enum.TokenType, ) (int64, error)
DeleteExpiredBefore deletes all tokens that expired before the provided time. If tokenTypes are provided, then only tokens of that type are deleted.
func (*TokenStore) FindByIdentifier ¶
func (s *TokenStore) FindByIdentifier(ctx context.Context, principalID int64, identifier string) (*types.Token, error)
FindByIdentifier finds the token by principalId and token identifier.
type UserGroup ¶
type UserGroup struct {
SpaceID int64 `db:"usergroup_space_id"`
ID int64 `db:"usergroup_id"`
Identifier string `db:"usergroup_identifier"`
Name string `db:"usergroup_name"`
Description string `db:"usergroup_description"`
Created int64 `db:"usergroup_created"`
Updated int64 `db:"usergroup_updated"`
}
type UserGroupStore ¶
type UserGroupStore struct {
// contains filtered or unexported fields
}
func NewUserGroupStore ¶
func NewUserGroupStore(db *sqlx.DB) *UserGroupStore
func (*UserGroupStore) Create ¶
func (s *UserGroupStore) Create( ctx context.Context, spaceID int64, userGroup *types.UserGroup, ) error
Create Creates a usergroup in the database.
func (*UserGroupStore) CreateOrUpdate ¶
func (*UserGroupStore) FindByIdentifier ¶
func (s *UserGroupStore) FindByIdentifier( ctx context.Context, spaceID int64, identifier string, ) (*types.UserGroup, error)
FindByIdentifier returns a usergroup by its identifier.
func (*UserGroupStore) FindManyByIDs ¶
func (*UserGroupStore) FindManyByIdentifiersAndSpaceID ¶
type UsergroupReviewerStore ¶
type UsergroupReviewerStore struct {
// contains filtered or unexported fields
}
UsergroupReviewerStore implements store.UsergroupReviewerStore backed by a relational database.
func NewUsergroupReviewerStore ¶
func NewUsergroupReviewerStore( db *sqlx.DB, pCache store.PrincipalInfoCache, userGroupStore store.UserGroupStore, ) *UsergroupReviewerStore
func (*UsergroupReviewerStore) Create ¶
func (s *UsergroupReviewerStore) Create(ctx context.Context, v *types.UserGroupReviewer) error
Create creates a new pull request usergroup reviewer.
func (*UsergroupReviewerStore) Delete ¶
func (s *UsergroupReviewerStore) Delete(ctx context.Context, prID, userGroupReviewerID int64) error
Delete deletes a pull request usergroup reviewer.
func (*UsergroupReviewerStore) Find ¶
func (s *UsergroupReviewerStore) Find( ctx context.Context, prID, userGroupReviewerID int64, ) (*types.UserGroupReviewer, error)
Find returns a pull request usergroup reviewer by userGroupReviewerID.
func (*UsergroupReviewerStore) List ¶
func (s *UsergroupReviewerStore) List(ctx context.Context, prID int64) ([]*types.UserGroupReviewer, error)
List returns a list of pull request usergroup reviewers.
type WebhookExecutionStore ¶
type WebhookExecutionStore struct {
// contains filtered or unexported fields
}
WebhookExecutionStore implements store.WebhookExecution backed by a relational database.
func NewWebhookExecutionStore ¶
func NewWebhookExecutionStore(db *sqlx.DB) *WebhookExecutionStore
NewWebhookExecutionStore returns a new WebhookExecutionStore.
func (*WebhookExecutionStore) CountForWebhook ¶
func (s *WebhookExecutionStore) CountForWebhook( ctx context.Context, webhookID int64, ) (int64, error)
CountForWebhook counts the total number of webhook executions for a given webhook ID.
func (*WebhookExecutionStore) Create ¶
func (s *WebhookExecutionStore) Create(ctx context.Context, execution *types.WebhookExecution) error
Create creates a new webhook execution entry.
func (*WebhookExecutionStore) DeleteOld ¶
DeleteOld removes all executions that are older than the provided time.
func (*WebhookExecutionStore) Find ¶
func (s *WebhookExecutionStore) Find(ctx context.Context, id int64) (*types.WebhookExecution, error)
Find finds the webhook execution by id.
func (*WebhookExecutionStore) ListForTrigger ¶
func (s *WebhookExecutionStore) ListForTrigger(ctx context.Context, triggerID string) ([]*types.WebhookExecution, error)
ListForTrigger lists the webhook executions for a given trigger id.
func (*WebhookExecutionStore) ListForWebhook ¶
func (s *WebhookExecutionStore) ListForWebhook(ctx context.Context, webhookID int64, opts *types.WebhookExecutionFilter) ([]*types.WebhookExecution, error)
ListForWebhook lists the webhook executions for a given webhook id.
type WebhookStore ¶
type WebhookStore struct {
// contains filtered or unexported fields
}
WebhookStore implements store.Webhook backed by a relational database.
func NewWebhookStore ¶
func NewWebhookStore(db *sqlx.DB) *WebhookStore
NewWebhookStore returns a new WebhookStore.
func (*WebhookStore) Count ¶
func (s *WebhookStore) Count( ctx context.Context, parents []types.WebhookParentInfo, opts *types.WebhookFilter, ) (int64, error)
Count counts the webhooks for a given parent type and id.
func (*WebhookStore) Delete ¶
func (s *WebhookStore) Delete(ctx context.Context, id int64) error
Delete deletes the webhook for the given id.
func (*WebhookStore) DeleteByIdentifier ¶
func (s *WebhookStore) DeleteByIdentifier( ctx context.Context, parentType enum.WebhookParent, parentID int64, identifier string, ) error
DeleteByIdentifier deletes the webhook with the given Identifier for the given parent.
func (*WebhookStore) FindByIdentifier ¶
func (s *WebhookStore) FindByIdentifier( ctx context.Context, parentType enum.WebhookParent, parentID int64, identifier string, ) (*types.Webhook, error)
FindByIdentifier finds the webhook with the given Identifier for the given parent.
func (*WebhookStore) List ¶
func (s *WebhookStore) List( ctx context.Context, parents []types.WebhookParentInfo, opts *types.WebhookFilter, ) ([]*types.Webhook, error)
Source Files
¶
- ai.go
- check.go
- code_comment.go
- connector.go
- database.go
- dsn.go
- encode.go
- execution.go
- execution_map.go
- gitspace_config.go
- gitspace_event.go
- gitspace_instance.go
- infra_provider_config.go
- infra_provider_resource.go
- infra_provider_template.go
- infra_provisioned.go
- job.go
- label.go
- label_pullreq.go
- label_value.go
- membership.go
- pipeline.go
- pipeline_join.go
- plugin.go
- principal.go
- principal_info.go
- principal_service.go
- principal_service_account.go
- principal_user.go
- public_access.go
- publickey.go
- pullreq.go
- pullreq_activity.go
- pullreq_file_view_store.go
- pullreq_reviewers.go
- pullreq_reviews.go
- repo.go
- repo_git_info.go
- rule.go
- secret.go
- settings.go
- space.go
- space_path.go
- stage.go
- stage_map.go
- step.go
- step_map.go
- template.go
- token.go
- trigger.go
- usergroup.go
- usergroup_reviewers.go
- webhook.go
- webhook_execution.go
- wire.go