@@ -18,33 +18,10 @@ type (
18
18
PermStore
19
19
DeploymentStore
20
20
DeploymentStatusStore
21
-
22
- FindDeploymentStatisticsOfRepoByEnv (ctx context.Context , r * ent.Repo , env string ) (* ent.DeploymentStatistics , error )
23
- CreateDeploymentStatistics (ctx context.Context , s * ent.DeploymentStatistics ) (* ent.DeploymentStatistics , error )
24
- UpdateDeploymentStatistics (ctx context.Context , s * ent.DeploymentStatistics ) (* ent.DeploymentStatistics , error )
25
-
26
- ListAllDeploymentStatistics (ctx context.Context ) ([]* ent.DeploymentStatistics , error )
27
- ListDeploymentStatisticsGreaterThanTime (ctx context.Context , updated time.Time ) ([]* ent.DeploymentStatistics , error )
28
-
29
- SearchReviews (ctx context.Context , u * ent.User ) ([]* ent.Review , error )
30
- ListReviews (ctx context.Context , d * ent.Deployment ) ([]* ent.Review , error )
31
- FindReviewOfUser (ctx context.Context , u * ent.User , d * ent.Deployment ) (* ent.Review , error )
32
- FindReviewByID (ctx context.Context , id int ) (* ent.Review , error )
33
- CreateReview (ctx context.Context , rv * ent.Review ) (* ent.Review , error )
34
- UpdateReview (ctx context.Context , rv * ent.Review ) (* ent.Review , error )
35
-
36
- ListExpiredLocksLessThanTime (ctx context.Context , t time.Time ) ([]* ent.Lock , error )
37
- ListLocksOfRepo (ctx context.Context , r * ent.Repo ) ([]* ent.Lock , error )
38
- FindLockOfRepoByEnv (ctx context.Context , r * ent.Repo , env string ) (* ent.Lock , error )
39
- HasLockOfRepoForEnv (ctx context.Context , r * ent.Repo , env string ) (bool , error )
40
- FindLockByID (ctx context.Context , id int ) (* ent.Lock , error )
41
- CreateLock (ctx context.Context , l * ent.Lock ) (* ent.Lock , error )
42
- UpdateLock (ctx context.Context , l * ent.Lock ) (* ent.Lock , error )
43
- DeleteLock (ctx context.Context , l * ent.Lock ) error
44
-
45
- ListEventsGreaterThanTime (ctx context.Context , t time.Time ) ([]* ent.Event , error )
46
- CreateEvent (ctx context.Context , e * ent.Event ) (* ent.Event , error )
47
- CheckNotificationRecordOfEvent (ctx context.Context , e * ent.Event ) bool
21
+ DeploymentStatisticsStore
22
+ LockStore
23
+ ReviewStore
24
+ EventStore
48
25
}
49
26
50
27
// PermStore defines operations for working with perms.
@@ -70,24 +47,48 @@ type (
70
47
SyncDeploymentStatus (ctx context.Context , ds * ent.DeploymentStatus ) (* ent.DeploymentStatus , error )
71
48
}
72
49
50
+ // ReviewStore defines operations for working with reviews.
51
+ ReviewStore interface {
52
+ SearchReviews (ctx context.Context , u * ent.User ) ([]* ent.Review , error )
53
+ ListReviews (ctx context.Context , d * ent.Deployment ) ([]* ent.Review , error )
54
+ FindReviewOfUser (ctx context.Context , u * ent.User , d * ent.Deployment ) (* ent.Review , error )
55
+ FindReviewByID (ctx context.Context , id int ) (* ent.Review , error )
56
+ CreateReview (ctx context.Context , rv * ent.Review ) (* ent.Review , error )
57
+ UpdateReview (ctx context.Context , rv * ent.Review ) (* ent.Review , error )
58
+ }
59
+
73
60
SCM interface {
74
61
UserSCM
75
62
RepoSCM
76
63
DeploymentSCM
64
+ DeploymentStatusSCM
65
+ CommitSCM
66
+ BranchSCM
67
+ TagSCM
77
68
69
+ GetRateLimit (ctx context.Context , u * ent.User ) (* extent.RateLimit , error )
70
+ }
71
+
72
+ // DeploymentStatusSCM defines operations for working with remote deployment status.
73
+ DeploymentStatusSCM interface {
78
74
CreateRemoteDeploymentStatus (ctx context.Context , u * ent.User , r * ent.Repo , d * ent.Deployment , ds * extent.RemoteDeploymentStatus ) (* extent.RemoteDeploymentStatus , error )
75
+ }
79
76
80
- ListCommits (ctx context.Context , u * ent.User , r * ent.Repo , branch string , page , perPage int ) ([]* extent.Commit , error )
81
- CompareCommits (ctx context.Context , u * ent.User , r * ent.Repo , base , head string , page , perPage int ) ([]* extent.Commit , []* extent.CommitFile , error )
77
+ // CommitSCM defines operations for working with commit.
78
+ CommitSCM interface {
79
+ ListCommits (ctx context.Context , u * ent.User , r * ent.Repo , branch string , opt * ListOptions ) ([]* extent.Commit , error )
80
+ CompareCommits (ctx context.Context , u * ent.User , r * ent.Repo , base , head string , opt * ListOptions ) ([]* extent.Commit , []* extent.CommitFile , error )
82
81
GetCommit (ctx context.Context , u * ent.User , r * ent.Repo , sha string ) (* extent.Commit , error )
83
82
ListCommitStatuses (ctx context.Context , u * ent.User , r * ent.Repo , sha string ) ([]* extent.Status , error )
83
+ }
84
84
85
- ListBranches (ctx context.Context , u * ent.User , r * ent.Repo , page , perPage int ) ([]* extent.Branch , error )
85
+ BranchSCM interface {
86
+ ListBranches (ctx context.Context , u * ent.User , r * ent.Repo , opt * ListOptions ) ([]* extent.Branch , error )
86
87
GetBranch (ctx context.Context , u * ent.User , r * ent.Repo , branch string ) (* extent.Branch , error )
88
+ }
87
89
88
- ListTags (ctx context.Context , u * ent.User , r * ent.Repo , page , perPage int ) ([]* extent.Tag , error )
90
+ TagSCM interface {
91
+ ListTags (ctx context.Context , u * ent.User , r * ent.Repo , opt * ListOptions ) ([]* extent.Tag , error )
89
92
GetTag (ctx context.Context , u * ent.User , r * ent.Repo , tag string ) (* extent.Tag , error )
90
-
91
- GetRateLimit (ctx context.Context , u * ent.User ) (* extent.RateLimit , error )
92
93
}
93
94
)
0 commit comments