gitea: code.gitea.io/gitea/modules/migrations Index | Files | Directories

package migrations

import "code.gitea.io/gitea/modules/migrations"

Index

Package Files

error.go git.go gitea.go github.go migrate.go update.go

Variables

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

func IsRateLimitError Uses

func IsRateLimitError(err error) bool

IsRateLimitError returns true if the err is github.RateLimitError

func IsTwoFactorAuthError Uses

func IsTwoFactorAuthError(err error) bool

IsTwoFactorAuthError returns true if the err is github.TwoFactorAuthError

func MigrateRepository Uses

func MigrateRepository(doer *models.User, ownerName string, opts base.MigrateOptions) (*models.Repository, error)

MigrateRepository migrate repository according MigrateOptions

func RegisterDownloaderFactory Uses

func RegisterDownloaderFactory(factory base.DownloaderFactory)

RegisterDownloaderFactory registers a downloader factory

func UpdateMigrationPosterID Uses

func UpdateMigrationPosterID()

UpdateMigrationPosterID updates all migrated repositories' issues and comments posterID

type GiteaLocalUploader Uses

type GiteaLocalUploader struct {
    // contains filtered or unexported fields
}

GiteaLocalUploader implements an Uploader to gitea sites

func NewGiteaLocalUploader Uses

func NewGiteaLocalUploader(doer *models.User, repoOwner, repoName string) *GiteaLocalUploader

NewGiteaLocalUploader creates an gitea Uploader via gitea API v1

func (*GiteaLocalUploader) Close Uses

func (g *GiteaLocalUploader) Close()

Close closes this uploader

func (*GiteaLocalUploader) CreateComments Uses

func (g *GiteaLocalUploader) CreateComments(comments ...*base.Comment) error

CreateComments creates comments of issues

func (*GiteaLocalUploader) CreateIssues Uses

func (g *GiteaLocalUploader) CreateIssues(issues ...*base.Issue) error

CreateIssues creates issues

func (*GiteaLocalUploader) CreateLabels Uses

func (g *GiteaLocalUploader) CreateLabels(labels ...*base.Label) error

CreateLabels creates labels

func (*GiteaLocalUploader) CreateMilestones Uses

func (g *GiteaLocalUploader) CreateMilestones(milestones ...*base.Milestone) error

CreateMilestones creates milestones

func (*GiteaLocalUploader) CreatePullRequests Uses

func (g *GiteaLocalUploader) CreatePullRequests(prs ...*base.PullRequest) error

CreatePullRequests creates pull requests

func (*GiteaLocalUploader) CreateReleases Uses

func (g *GiteaLocalUploader) CreateReleases(releases ...*base.Release) error

CreateReleases creates releases

func (*GiteaLocalUploader) CreateRepo Uses

func (g *GiteaLocalUploader) CreateRepo(repo *base.Repository, opts base.MigrateOptions) error

CreateRepo creates a repository

func (*GiteaLocalUploader) CreateTopics Uses

func (g *GiteaLocalUploader) CreateTopics(topics ...string) error

CreateTopics creates topics

func (*GiteaLocalUploader) MaxBatchInsertSize Uses

func (g *GiteaLocalUploader) MaxBatchInsertSize(tp string) int

MaxBatchInsertSize returns the table's max batch insert size

func (*GiteaLocalUploader) Rollback Uses

func (g *GiteaLocalUploader) Rollback() error

Rollback when migrating failed, this will rollback all the changes.

type GithubDownloaderV3 Uses

type GithubDownloaderV3 struct {
    // contains filtered or unexported fields
}

GithubDownloaderV3 implements a Downloader interface to get repository informations from github via APIv3

func NewGithubDownloaderV3 Uses

func NewGithubDownloaderV3(userName, password, repoOwner, repoName string) *GithubDownloaderV3

NewGithubDownloaderV3 creates a github Downloader via github v3 API

func (*GithubDownloaderV3) GetComments Uses

func (g *GithubDownloaderV3) GetComments(issueNumber int64) ([]*base.Comment, error)

GetComments returns comments according issueNumber

func (*GithubDownloaderV3) GetIssues Uses

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

GetIssues returns issues according start and limit

func (*GithubDownloaderV3) GetLabels Uses

func (g *GithubDownloaderV3) GetLabels() ([]*base.Label, error)

GetLabels returns labels

func (*GithubDownloaderV3) GetMilestones Uses

func (g *GithubDownloaderV3) GetMilestones() ([]*base.Milestone, error)

GetMilestones returns milestones

func (*GithubDownloaderV3) GetPullRequests Uses

func (g *GithubDownloaderV3) GetPullRequests(page, perPage int) ([]*base.PullRequest, error)

GetPullRequests returns pull requests according page and perPage

func (*GithubDownloaderV3) GetReleases Uses

func (g *GithubDownloaderV3) GetReleases() ([]*base.Release, error)

GetReleases returns releases

func (*GithubDownloaderV3) GetRepoInfo Uses

func (g *GithubDownloaderV3) GetRepoInfo() (*base.Repository, error)

GetRepoInfo returns a repository information

func (*GithubDownloaderV3) GetTopics Uses

func (g *GithubDownloaderV3) GetTopics() ([]string, error)

GetTopics return github topics

type GithubDownloaderV3Factory Uses

type GithubDownloaderV3Factory struct {
}

GithubDownloaderV3Factory defines a github downloader v3 factory

func (*GithubDownloaderV3Factory) GitServiceType Uses

func (f *GithubDownloaderV3Factory) GitServiceType() structs.GitServiceType

GitServiceType returns the type of git service

func (*GithubDownloaderV3Factory) Match Uses

func (f *GithubDownloaderV3Factory) Match(opts base.MigrateOptions) (bool, error)

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

func (*GithubDownloaderV3Factory) New Uses

func (f *GithubDownloaderV3Factory) New(opts base.MigrateOptions) (base.Downloader, error)

New returns a Downloader related to this factory according MigrateOptions

type MigrateOptions Uses

type MigrateOptions = base.MigrateOptions

MigrateOptions is equal to base.MigrateOptions

type PlainGitDownloader Uses

type PlainGitDownloader struct {
    // contains filtered or unexported fields
}

PlainGitDownloader implements a Downloader interface to clone git from a http/https URL

func NewPlainGitDownloader Uses

func NewPlainGitDownloader(ownerName, repoName, remoteURL string) *PlainGitDownloader

NewPlainGitDownloader creates a git Downloader

func (*PlainGitDownloader) GetComments Uses

func (g *PlainGitDownloader) GetComments(issueNumber int64) ([]*base.Comment, error)

GetComments returns comments according issueNumber

func (*PlainGitDownloader) GetIssues Uses

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

GetIssues returns issues according page and perPage

func (*PlainGitDownloader) GetLabels Uses

func (g *PlainGitDownloader) GetLabels() ([]*base.Label, error)

GetLabels returns labels

func (*PlainGitDownloader) GetMilestones Uses

func (g *PlainGitDownloader) GetMilestones() ([]*base.Milestone, error)

GetMilestones returns milestones

func (*PlainGitDownloader) GetPullRequests Uses

func (g *PlainGitDownloader) GetPullRequests(start, limit int) ([]*base.PullRequest, error)

GetPullRequests returns pull requests according page and perPage

func (*PlainGitDownloader) GetReleases Uses

func (g *PlainGitDownloader) GetReleases() ([]*base.Release, error)

GetReleases returns releases

func (*PlainGitDownloader) GetRepoInfo Uses

func (g *PlainGitDownloader) GetRepoInfo() (*base.Repository, error)

GetRepoInfo returns a repository information

func (*PlainGitDownloader) GetTopics Uses

func (g *PlainGitDownloader) GetTopics() ([]string, error)

GetTopics returns empty list for plain git repo

Directories

PathSynopsis
base

Package migrations imports 22 packages (graph) and is imported by 11 packages. Updated 2019-11-22. Refresh now. Tools for package owners.