0
0
mirror of https://gitea.com/gitea/docs.git synced 2025-05-07 20:51:09 +00:00
Files
appleboy dbfa0ba454 docs: add zh-tw folder (#195)
Signed-off-by: appleboy <appleboy.tw@gmail.com>
Reviewed-on: https://gitea.com/gitea/docs/pulls/195
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: appleboy <appleboy.tw@gmail.com>
Co-committed-by: appleboy <appleboy.tw@gmail.com>
2025-04-04 23:28:16 +00:00

1.5 KiB
Raw Permalink Blame History

date, slug, sidebar_position, aliases
date slug sidebar_position aliases
2019-04-15T17:29:00+08:00 migrations-interfaces 55
/zh-tw/migrations-interfaces

遷移介面

完整的遷移在 Gitea 1.9.0 中引入。它定義了兩個介面來支持從其他 Git 主機平台遷移倉庫數據到 Gitea或者在未來將 Gitea 數據遷移到其他 Git 主機平台。

目前,已實現從 GitHub、GitLab 和其他 Gitea 實例的遷移。

首先Gitea 在 modules/migration 包中定義了一些標準對象。它們是 RepositoryMilestoneReleaseReleaseAssetLabelIssueCommentPullRequestReactionReviewReviewComment

下載器介面

要從新的 Git 主機平台遷移,有兩個步驟需要更新。

  • 你應該實現一個 Downloader,它將用於獲取倉庫信息。
  • 你應該實現一個 DownloaderFactory,它將用於檢測 URL 是否匹配並創建上述 Downloader
    • 你需要在 init() 中通過 RegisterDownloaderFactory 註冊 DownloaderFactory

你可以在 downloader.go 中找到這些介面。

上傳器介面

目前,只實現了一個 GiteaLocalUploader,因此我們僅通過此 Uploader 將下載的數據保存到本地 Gitea 實例。其他上傳器目前不支持。

你可以在 uploader.go 中找到這些介面。