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
|
@ -12,18 +12,17 @@ import (
|
|||
|
||||
// Downloader downloads the site repo information
|
||||
type Downloader interface {
|
||||
SetContext(context.Context)
|
||||
GetRepoInfo() (*Repository, error)
|
||||
GetTopics() ([]string, error)
|
||||
GetMilestones() ([]*Milestone, error)
|
||||
GetReleases() ([]*Release, error)
|
||||
GetLabels() ([]*Label, error)
|
||||
GetIssues(page, perPage int) ([]*Issue, bool, error)
|
||||
GetComments(commentable Commentable) ([]*Comment, bool, error)
|
||||
GetAllComments(page, perPage int) ([]*Comment, bool, error)
|
||||
GetRepoInfo(ctx context.Context) (*Repository, error)
|
||||
GetTopics(ctx context.Context) ([]string, error)
|
||||
GetMilestones(ctx context.Context) ([]*Milestone, error)
|
||||
GetReleases(ctx context.Context) ([]*Release, error)
|
||||
GetLabels(ctx context.Context) ([]*Label, error)
|
||||
GetIssues(ctx context.Context, page, perPage int) ([]*Issue, bool, error)
|
||||
GetComments(ctx context.Context, commentable Commentable) ([]*Comment, bool, error)
|
||||
GetAllComments(ctx context.Context, page, perPage int) ([]*Comment, bool, error)
|
||||
SupportGetRepoComments() bool
|
||||
GetPullRequests(page, perPage int) ([]*PullRequest, bool, error)
|
||||
GetReviews(reviewable Reviewable) ([]*Review, error)
|
||||
GetPullRequests(ctx context.Context, page, perPage int) ([]*PullRequest, bool, error)
|
||||
GetReviews(ctx context.Context, reviewable Reviewable) ([]*Review, error)
|
||||
FormatCloneURL(opts MigrateOptions, remoteAddr string) (string, error)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue