store

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 27, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

func NewStore

func NewStore(c *ent.Client) *Store

func (*Store) Activate

func (s *Store) Activate(ctx context.Context, r *ent.Repo) (*ent.Repo, error)

func (*Store) CheckNotificationRecordOfEvent

func (s *Store) CheckNotificationRecordOfEvent(ctx context.Context, e *ent.Event) bool

func (*Store) CountActiveRepos

func (s *Store) CountActiveRepos(ctx context.Context) (int, error)

func (*Store) CountDeployments

func (s *Store) CountDeployments(ctx context.Context) (int, error)

func (*Store) CountRepos

func (s *Store) CountRepos(ctx context.Context) (int, error)

func (*Store) CountUsers

func (s *Store) CountUsers(ctx context.Context) (int, error)

func (*Store) CreateChatUser

func (s *Store) CreateChatUser(ctx context.Context, cu *ent.ChatUser) (*ent.ChatUser, error)

func (*Store) CreateDeployment

func (s *Store) CreateDeployment(ctx context.Context, d *ent.Deployment) (*ent.Deployment, error)

CreateDeployment create a new deployment, and it updates the 'latest_deployed_at' field of the repository.

func (*Store) CreateDeploymentStatistics

func (s *Store) CreateDeploymentStatistics(ctx context.Context, ds *ent.DeploymentStatistics) (*ent.DeploymentStatistics, error)

func (*Store) CreateEntDeploymentStatus

func (s *Store) CreateEntDeploymentStatus(ctx context.Context, ds *ent.DeploymentStatus) (*ent.DeploymentStatus, error)

func (*Store) CreateEvent

func (s *Store) CreateEvent(ctx context.Context, e *ent.Event) (*ent.Event, error)

func (*Store) CreateLock

func (s *Store) CreateLock(ctx context.Context, l *ent.Lock) (*ent.Lock, error)

func (*Store) CreatePerm

func (s *Store) CreatePerm(ctx context.Context, p *ent.Perm) (*ent.Perm, error)

func (*Store) CreateReview

func (s *Store) CreateReview(ctx context.Context, rv *ent.Review) (*ent.Review, error)

func (*Store) CreateUser

func (s *Store) CreateUser(ctx context.Context, u *ent.User) (*ent.User, error)

func (*Store) Deactivate

func (s *Store) Deactivate(ctx context.Context, r *ent.Repo) (*ent.Repo, error)

func (*Store) DeleteChatUser

func (s *Store) DeleteChatUser(ctx context.Context, cu *ent.ChatUser) error

func (*Store) DeleteLock

func (s *Store) DeleteLock(ctx context.Context, l *ent.Lock) error

func (*Store) DeletePerm

func (s *Store) DeletePerm(ctx context.Context, p *ent.Perm) error

func (*Store) DeletePermsOfUserLessThanSyncedAt

func (s *Store) DeletePermsOfUserLessThanSyncedAt(ctx context.Context, u *ent.User, t time.Time) (int, error)

func (*Store) DeleteUser

func (s *Store) DeleteUser(ctx context.Context, u *ent.User) error

func (*Store) FindChatUserByID

func (s *Store) FindChatUserByID(ctx context.Context, id string) (*ent.ChatUser, error)

func (*Store) FindDeploymentByID

func (s *Store) FindDeploymentByID(ctx context.Context, id int) (*ent.Deployment, error)

func (*Store) FindDeploymentByUID

func (s *Store) FindDeploymentByUID(ctx context.Context, uid int64) (*ent.Deployment, error)

func (*Store) FindDeploymentOfRepoByNumber

func (s *Store) FindDeploymentOfRepoByNumber(ctx context.Context, r *ent.Repo, number int) (*ent.Deployment, error)

func (*Store) FindDeploymentStatisticsOfRepoByEnv

func (s *Store) FindDeploymentStatisticsOfRepoByEnv(ctx context.Context, r *ent.Repo, env string) (*ent.DeploymentStatistics, error)

func (*Store) FindDeploymentStatusByID

func (s *Store) FindDeploymentStatusByID(ctx context.Context, id int) (*ent.DeploymentStatus, error)

func (*Store) FindLockByID

func (s *Store) FindLockByID(ctx context.Context, id int) (*ent.Lock, error)

func (*Store) FindLockOfRepoByEnv

func (s *Store) FindLockOfRepoByEnv(ctx context.Context, r *ent.Repo, env string) (*ent.Lock, error)

func (*Store) FindPermOfRepo

func (s *Store) FindPermOfRepo(ctx context.Context, r *ent.Repo, u *ent.User) (*ent.Perm, error)

func (*Store) FindPrevRunningDeployment

func (s *Store) FindPrevRunningDeployment(ctx context.Context, d *ent.Deployment) (*ent.Deployment, error)

FindPrevRunningDeployment find a deployment of which the status is created, queued, or running.

func (*Store) FindPrevSuccessDeployment

func (s *Store) FindPrevSuccessDeployment(ctx context.Context, d *ent.Deployment) (*ent.Deployment, error)

func (*Store) FindRepoByID

func (s *Store) FindRepoByID(ctx context.Context, id int64) (*ent.Repo, error)

func (*Store) FindRepoOfUserByID

func (s *Store) FindRepoOfUserByID(ctx context.Context, u *ent.User, id int64) (*ent.Repo, error)

func (*Store) FindRepoOfUserByNamespaceName

func (s *Store) FindRepoOfUserByNamespaceName(ctx context.Context, u *ent.User, opt *i.FindRepoOfUserByNamespaceNameOptions) (*ent.Repo, error)

func (*Store) FindReviewByID

func (s *Store) FindReviewByID(ctx context.Context, id int) (*ent.Review, error)

func (*Store) FindReviewOfUser

func (s *Store) FindReviewOfUser(ctx context.Context, u *ent.User, d *ent.Deployment) (*ent.Review, error)

func (*Store) FindUserByHash

func (s *Store) FindUserByHash(ctx context.Context, hash string) (*ent.User, error)

func (*Store) FindUserByID

func (s *Store) FindUserByID(ctx context.Context, id int64) (*ent.User, error)

FindUserByID return the user with chat_user, but it returns nil if chat_user is not found.

Note that add new indexes if you need to more edges.

func (*Store) FindUserByLogin

func (s *Store) FindUserByLogin(ctx context.Context, login string) (*ent.User, error)

func (*Store) GetNextDeploymentNumberOfRepo

func (s *Store) GetNextDeploymentNumberOfRepo(ctx context.Context, r *ent.Repo) (int, error)

func (*Store) HasLockOfRepoForEnv

func (s *Store) HasLockOfRepoForEnv(ctx context.Context, r *ent.Repo, env string) (bool, error)

func (*Store) ListAllDeploymentStatistics

func (s *Store) ListAllDeploymentStatistics(ctx context.Context) ([]*ent.DeploymentStatistics, error)

func (*Store) ListDeploymentStatisticsGreaterThanTime

func (s *Store) ListDeploymentStatisticsGreaterThanTime(ctx context.Context, updated time.Time) ([]*ent.DeploymentStatistics, error)

func (*Store) ListDeploymentStatuses

func (s *Store) ListDeploymentStatuses(ctx context.Context, d *ent.Deployment) ([]*ent.DeploymentStatus, error)

func (*Store) ListDeploymentsOfRepo

func (s *Store) ListDeploymentsOfRepo(ctx context.Context, r *ent.Repo, opt *i.ListDeploymentsOfRepoOptions) ([]*ent.Deployment, error)

func (*Store) ListEventsGreaterThanTime

func (s *Store) ListEventsGreaterThanTime(ctx context.Context, t time.Time) ([]*ent.Event, error)

ListEventsGreaterThanTime returns all events for deployment and review that are greater than the time.

It processes eager loading, especially, review loads a repository of deployment.

func (*Store) ListExpiredLocksLessThanTime

func (s *Store) ListExpiredLocksLessThanTime(ctx context.Context, t time.Time) ([]*ent.Lock, error)

func (*Store) ListInactiveDeploymentsLessThanTime

func (s *Store) ListInactiveDeploymentsLessThanTime(ctx context.Context, opt *i.ListInactiveDeploymentsLessThanTimeOptions) ([]*ent.Deployment, error)

func (*Store) ListLocksOfRepo

func (s *Store) ListLocksOfRepo(ctx context.Context, r *ent.Repo) ([]*ent.Lock, error)

func (*Store) ListPerms

func (s *Store) ListPerms(ctx context.Context, opt *i.ListOptions) ([]*ent.Perm, error)

func (*Store) ListPermsOfRepo

func (s *Store) ListPermsOfRepo(ctx context.Context, r *ent.Repo, opt *i.ListPermsOfRepoOptions) ([]*ent.Perm, error)

func (*Store) ListReposOfUser

func (s *Store) ListReposOfUser(ctx context.Context, u *ent.User, opt *i.ListReposOfUserOptions) ([]*ent.Repo, error)

func (*Store) ListReviews

func (s *Store) ListReviews(ctx context.Context, d *ent.Deployment) ([]*ent.Review, error)

func (*Store) SearchDeploymentsOfUser

func (s *Store) SearchDeploymentsOfUser(ctx context.Context, u *ent.User, opt *i.SearchDeploymentsOfUserOptions) ([]*ent.Deployment, error)

func (*Store) SearchReviews

func (s *Store) SearchReviews(ctx context.Context, u *ent.User) ([]*ent.Review, error)

func (*Store) SearchUsers

func (s *Store) SearchUsers(ctx context.Context, opts *i.SearchUsersOptions) ([]*ent.User, error)

func (*Store) SyncRepo

func (s *Store) SyncRepo(ctx context.Context, r *extent.RemoteRepo) (*ent.Repo, error)

func (*Store) UpdateChatUser

func (s *Store) UpdateChatUser(ctx context.Context, cu *ent.ChatUser) (*ent.ChatUser, error)

func (*Store) UpdateDeployment

func (s *Store) UpdateDeployment(ctx context.Context, d *ent.Deployment) (*ent.Deployment, error)

func (*Store) UpdateDeploymentStatistics

func (s *Store) UpdateDeploymentStatistics(ctx context.Context, ds *ent.DeploymentStatistics) (*ent.DeploymentStatistics, error)

func (*Store) UpdateLock

func (s *Store) UpdateLock(ctx context.Context, l *ent.Lock) (*ent.Lock, error)

func (*Store) UpdatePerm

func (s *Store) UpdatePerm(ctx context.Context, p *ent.Perm) (*ent.Perm, error)

func (*Store) UpdateRepo

func (s *Store) UpdateRepo(ctx context.Context, r *ent.Repo) (*ent.Repo, error)

func (*Store) UpdateReview

func (s *Store) UpdateReview(ctx context.Context, rv *ent.Review) (*ent.Review, error)

func (*Store) UpdateUser

func (s *Store) UpdateUser(ctx context.Context, u *ent.User) (*ent.User, error)

func (*Store) WithTx

func (s *Store) WithTx(ctx context.Context, fn func(tx *ent.Tx) error) error

WithTx runs callbacks in a transaction.

Jump to

Keyboard shortcuts

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