Documentation ¶
Index ¶
- Variables
- func IsRateLimitError(err error) bool
- func IsTwoFactorAuthError(err error) bool
- func MigrateRepository(doer *models.User, ownerName string, opts base.MigrateOptions) (*models.Repository, error)
- func RegisterDownloaderFactory(factory base.DownloaderFactory)
- type GiteaLocalUploader
- func (g *GiteaLocalUploader) Close()
- func (g *GiteaLocalUploader) CreateComments(comments ...*base.Comment) error
- func (g *GiteaLocalUploader) CreateIssues(issues ...*base.Issue) error
- func (g *GiteaLocalUploader) CreateLabels(labels ...*base.Label) error
- func (g *GiteaLocalUploader) CreateMilestones(milestones ...*base.Milestone) error
- func (g *GiteaLocalUploader) CreatePullRequests(prs ...*base.PullRequest) error
- func (g *GiteaLocalUploader) CreateReleases(releases ...*base.Release) error
- func (g *GiteaLocalUploader) CreateRepo(repo *base.Repository, opts base.MigrateOptions) error
- func (g *GiteaLocalUploader) MaxBatchInsertSize(tp string) int
- func (g *GiteaLocalUploader) Rollback() error
- type GithubDownloaderV3
- func (g *GithubDownloaderV3) GetComments(issueNumber int64) ([]*base.Comment, error)
- func (g *GithubDownloaderV3) GetIssues(page, perPage int) ([]*base.Issue, bool, error)
- func (g *GithubDownloaderV3) GetLabels() ([]*base.Label, error)
- func (g *GithubDownloaderV3) GetMilestones() ([]*base.Milestone, error)
- func (g *GithubDownloaderV3) GetPullRequests(page, perPage int) ([]*base.PullRequest, error)
- func (g *GithubDownloaderV3) GetReleases() ([]*base.Release, error)
- func (g *GithubDownloaderV3) GetRepoInfo() (*base.Repository, error)
- type GithubDownloaderV3Factory
- type MigrateOptions
- type PlainGitDownloader
- func (g *PlainGitDownloader) GetComments(issueNumber int64) ([]*base.Comment, error)
- func (g *PlainGitDownloader) GetIssues(page, perPage int) ([]*base.Issue, bool, error)
- func (g *PlainGitDownloader) GetLabels() ([]*base.Label, error)
- func (g *PlainGitDownloader) GetMilestones() ([]*base.Milestone, error)
- func (g *PlainGitDownloader) GetPullRequests(start, limit int) ([]*base.PullRequest, error)
- func (g *PlainGitDownloader) GetReleases() ([]*base.Release, error)
- func (g *PlainGitDownloader) GetRepoInfo() (*base.Repository, error)
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNotSupported returns the error not supported ErrNotSupported = errors.New("not supported") )
Functions ¶
func IsRateLimitError ¶
IsRateLimitError returns true if the err is github.RateLimitError
func IsTwoFactorAuthError ¶
IsTwoFactorAuthError returns true if the err is github.TwoFactorAuthError
func MigrateRepository ¶
func MigrateRepository(doer *models.User, ownerName string, opts base.MigrateOptions) (*models.Repository, error)
MigrateRepository migrate repository according MigrateOptions
func RegisterDownloaderFactory ¶
func RegisterDownloaderFactory(factory base.DownloaderFactory)
RegisterDownloaderFactory registers a downloader factory
Types ¶
type GiteaLocalUploader ¶
type GiteaLocalUploader struct {
// contains filtered or unexported fields
}
GiteaLocalUploader implements an Uploader to gitea sites
func NewGiteaLocalUploader ¶
func NewGiteaLocalUploader(doer *models.User, repoOwner, repoName string) *GiteaLocalUploader
NewGiteaLocalUploader creates an gitea Uploader via gitea API v1
func (*GiteaLocalUploader) Close ¶ added in v1.9.6
func (g *GiteaLocalUploader) Close()
Close closes this uploader
func (*GiteaLocalUploader) CreateComments ¶
func (g *GiteaLocalUploader) CreateComments(comments ...*base.Comment) error
CreateComments creates comments of issues
func (*GiteaLocalUploader) CreateIssues ¶
func (g *GiteaLocalUploader) CreateIssues(issues ...*base.Issue) error
CreateIssues creates issues
func (*GiteaLocalUploader) CreateLabels ¶
func (g *GiteaLocalUploader) CreateLabels(labels ...*base.Label) error
CreateLabels creates labels
func (*GiteaLocalUploader) CreateMilestones ¶
func (g *GiteaLocalUploader) CreateMilestones(milestones ...*base.Milestone) error
CreateMilestones creates milestones
func (*GiteaLocalUploader) CreatePullRequests ¶
func (g *GiteaLocalUploader) CreatePullRequests(prs ...*base.PullRequest) error
CreatePullRequests creates pull requests
func (*GiteaLocalUploader) CreateReleases ¶
func (g *GiteaLocalUploader) CreateReleases(releases ...*base.Release) error
CreateReleases creates releases
func (*GiteaLocalUploader) CreateRepo ¶
func (g *GiteaLocalUploader) CreateRepo(repo *base.Repository, opts base.MigrateOptions) error
CreateRepo creates a repository
func (*GiteaLocalUploader) MaxBatchInsertSize ¶
func (g *GiteaLocalUploader) MaxBatchInsertSize(tp string) int
MaxBatchInsertSize returns the table's max batch insert size
func (*GiteaLocalUploader) Rollback ¶
func (g *GiteaLocalUploader) Rollback() error
Rollback when migrating failed, this will rollback all the changes.
type GithubDownloaderV3 ¶
type GithubDownloaderV3 struct {
// contains filtered or unexported fields
}
GithubDownloaderV3 implements a Downloader interface to get repository informations from github via APIv3
func NewGithubDownloaderV3 ¶
func NewGithubDownloaderV3(userName, password, repoOwner, repoName string) *GithubDownloaderV3
NewGithubDownloaderV3 creates a github Downloader via github v3 API
func (*GithubDownloaderV3) GetComments ¶
func (g *GithubDownloaderV3) GetComments(issueNumber int64) ([]*base.Comment, error)
GetComments returns comments according issueNumber
func (*GithubDownloaderV3) GetLabels ¶
func (g *GithubDownloaderV3) GetLabels() ([]*base.Label, error)
GetLabels returns labels
func (*GithubDownloaderV3) GetMilestones ¶
func (g *GithubDownloaderV3) GetMilestones() ([]*base.Milestone, error)
GetMilestones returns milestones
func (*GithubDownloaderV3) GetPullRequests ¶
func (g *GithubDownloaderV3) GetPullRequests(page, perPage int) ([]*base.PullRequest, error)
GetPullRequests returns pull requests according page and perPage
func (*GithubDownloaderV3) GetReleases ¶
func (g *GithubDownloaderV3) GetReleases() ([]*base.Release, error)
GetReleases returns releases
func (*GithubDownloaderV3) GetRepoInfo ¶
func (g *GithubDownloaderV3) GetRepoInfo() (*base.Repository, error)
GetRepoInfo returns a repository information
type GithubDownloaderV3Factory ¶
type GithubDownloaderV3Factory struct { }
GithubDownloaderV3Factory defines a github downloader v3 factory
func (*GithubDownloaderV3Factory) Match ¶
func (f *GithubDownloaderV3Factory) Match(opts base.MigrateOptions) (bool, error)
Match returns ture if the migration remote URL matched this downloader factory
func (*GithubDownloaderV3Factory) New ¶
func (f *GithubDownloaderV3Factory) New(opts base.MigrateOptions) (base.Downloader, error)
New returns a Downloader related to this factory according MigrateOptions
type MigrateOptions ¶
type MigrateOptions = base.MigrateOptions
MigrateOptions is equal to base.MigrateOptions
type PlainGitDownloader ¶
type PlainGitDownloader struct {
// contains filtered or unexported fields
}
PlainGitDownloader implements a Downloader interface to clone git from a http/https URL
func NewPlainGitDownloader ¶
func NewPlainGitDownloader(ownerName, repoName, remoteURL string) *PlainGitDownloader
NewPlainGitDownloader creates a git Downloader
func (*PlainGitDownloader) GetComments ¶
func (g *PlainGitDownloader) GetComments(issueNumber int64) ([]*base.Comment, error)
GetComments returns comments according issueNumber
func (*PlainGitDownloader) GetLabels ¶
func (g *PlainGitDownloader) GetLabels() ([]*base.Label, error)
GetLabels returns labels
func (*PlainGitDownloader) GetMilestones ¶
func (g *PlainGitDownloader) GetMilestones() ([]*base.Milestone, error)
GetMilestones returns milestones
func (*PlainGitDownloader) GetPullRequests ¶
func (g *PlainGitDownloader) GetPullRequests(start, limit int) ([]*base.PullRequest, error)
GetPullRequests returns pull requests according page and perPage
func (*PlainGitDownloader) GetReleases ¶
func (g *PlainGitDownloader) GetReleases() ([]*base.Release, error)
GetReleases returns releases
func (*PlainGitDownloader) GetRepoInfo ¶
func (g *PlainGitDownloader) GetRepoInfo() (*base.Repository, error)
GetRepoInfo returns a repository information