2019-05-07 09:12:51 +08:00
|
|
|
// Copyright 2019 The Gitea Authors. All rights reserved.
|
|
|
|
|
// Copyright 2018 Jonas Franz. All rights reserved.
|
2022-11-27 13:20:29 -05:00
|
|
|
// SPDX-License-Identifier: MIT
|
2019-05-07 09:12:51 +08:00
|
|
|
|
2021-11-16 23:25:33 +08:00
|
|
|
package migration
|
2019-05-07 09:12:51 +08:00
|
|
|
|
2019-11-16 16:30:06 +08:00
|
|
|
import (
|
2019-12-17 12:16:54 +08:00
|
|
|
"context"
|
2019-11-16 16:30:06 +08:00
|
|
|
|
|
|
|
|
"code.gitea.io/gitea/modules/structs"
|
|
|
|
|
)
|
2019-10-14 14:10:42 +08:00
|
|
|
|
2021-07-08 07:38:13 -04:00
|
|
|
// Downloader downloads the site repo information
|
2019-05-07 09:12:51 +08:00
|
|
|
type Downloader interface {
|
2025-02-07 06:37:32 +01:00
|
|
|
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)
|
2021-06-30 15:23:49 +08:00
|
|
|
SupportGetRepoComments() bool
|
2025-02-07 06:37:32 +01:00
|
|
|
GetPullRequests(ctx context.Context, page, perPage int) ([]*PullRequest, bool, error)
|
|
|
|
|
GetReviews(ctx context.Context, reviewable Reviewable) ([]*Review, error)
|
2021-01-21 20:33:58 +01:00
|
|
|
FormatCloneURL(opts MigrateOptions, remoteAddr string) (string, error)
|
2019-05-07 09:12:51 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// DownloaderFactory defines an interface to match a downloader implementation and create a downloader
|
|
|
|
|
type DownloaderFactory interface {
|
2020-09-02 18:49:25 +01:00
|
|
|
New(ctx context.Context, opts MigrateOptions) (Downloader, error)
|
2019-10-14 14:10:42 +08:00
|
|
|
GitServiceType() structs.GitServiceType
|
2019-05-07 09:12:51 +08:00
|
|
|
}
|
2022-03-17 22:38:35 +05:30
|
|
|
|
|
|
|
|
// DownloaderContext has opaque information only relevant to a given downloader
|
2023-07-04 20:36:08 +02:00
|
|
|
type DownloaderContext any
|