gitea源码

12345678910111213141516171819202122232425262728293031323334353637
  1. // Copyright 2019 The Gitea Authors. All rights reserved.
  2. // Copyright 2018 Jonas Franz. All rights reserved.
  3. // SPDX-License-Identifier: MIT
  4. package migration
  5. import (
  6. "context"
  7. "code.gitea.io/gitea/modules/structs"
  8. )
  9. // Downloader downloads the site repo information
  10. type Downloader interface {
  11. GetRepoInfo(ctx context.Context) (*Repository, error)
  12. GetTopics(ctx context.Context) ([]string, error)
  13. GetMilestones(ctx context.Context) ([]*Milestone, error)
  14. GetReleases(ctx context.Context) ([]*Release, error)
  15. GetLabels(ctx context.Context) ([]*Label, error)
  16. GetIssues(ctx context.Context, page, perPage int) ([]*Issue, bool, error)
  17. GetComments(ctx context.Context, commentable Commentable) ([]*Comment, bool, error)
  18. GetAllComments(ctx context.Context, page, perPage int) ([]*Comment, bool, error)
  19. SupportGetRepoComments() bool
  20. GetPullRequests(ctx context.Context, page, perPage int) ([]*PullRequest, bool, error)
  21. GetReviews(ctx context.Context, reviewable Reviewable) ([]*Review, error)
  22. FormatCloneURL(opts MigrateOptions, remoteAddr string) (string, error)
  23. }
  24. // DownloaderFactory defines an interface to match a downloader implementation and create a downloader
  25. type DownloaderFactory interface {
  26. New(ctx context.Context, opts MigrateOptions) (Downloader, error)
  27. GitServiceType() structs.GitServiceType
  28. }
  29. // DownloaderContext has opaque information only relevant to a given downloader
  30. type DownloaderContext any