migrations

package
v1.10.0-dev Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 6, 2019 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotSupported returns the error not supported
	ErrNotSupported = errors.New("not supported")
)

Functions

func IsRateLimitError

func IsRateLimitError(err error) bool

IsRateLimitError returns true if the err is github.RateLimitError

func IsTwoFactorAuthError

func IsTwoFactorAuthError(err error) bool

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) 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) GetIssues

func (g *GithubDownloaderV3) GetIssues(page, perPage int) ([]*base.Issue, bool, error)

GetIssues returns issues according start and limit

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

Match returns ture if the migration remote URL matched this downloader factory

func (*GithubDownloaderV3Factory) New

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) GetIssues

func (g *PlainGitDownloader) GetIssues(page, perPage int) ([]*base.Issue, bool, error)

GetIssues returns issues according page and perPage

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL