refactor: decouple context from migration structs (#33399)
Use context as much as possible. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
parent
466cc725bc
commit
1ec8d80fa3
23 changed files with 455 additions and 509 deletions
|
@ -4,20 +4,22 @@
|
|||
|
||||
package migration
|
||||
|
||||
import "context"
|
||||
|
||||
// Uploader uploads all the information of one repository
|
||||
type Uploader interface {
|
||||
MaxBatchInsertSize(tp string) int
|
||||
CreateRepo(repo *Repository, opts MigrateOptions) error
|
||||
CreateTopics(topic ...string) error
|
||||
CreateMilestones(milestones ...*Milestone) error
|
||||
CreateReleases(releases ...*Release) error
|
||||
SyncTags() error
|
||||
CreateLabels(labels ...*Label) error
|
||||
CreateIssues(issues ...*Issue) error
|
||||
CreateComments(comments ...*Comment) error
|
||||
CreatePullRequests(prs ...*PullRequest) error
|
||||
CreateReviews(reviews ...*Review) error
|
||||
CreateRepo(ctx context.Context, repo *Repository, opts MigrateOptions) error
|
||||
CreateTopics(ctx context.Context, topic ...string) error
|
||||
CreateMilestones(ctx context.Context, milestones ...*Milestone) error
|
||||
CreateReleases(ctx context.Context, releases ...*Release) error
|
||||
SyncTags(ctx context.Context) error
|
||||
CreateLabels(ctx context.Context, labels ...*Label) error
|
||||
CreateIssues(ctx context.Context, issues ...*Issue) error
|
||||
CreateComments(ctx context.Context, comments ...*Comment) error
|
||||
CreatePullRequests(ctx context.Context, prs ...*PullRequest) error
|
||||
CreateReviews(ctx context.Context, reviews ...*Review) error
|
||||
Rollback() error
|
||||
Finish() error
|
||||
Finish(ctx context.Context) error
|
||||
Close()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue