Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

downloader.go 1.2KB

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. SetContext(context.Context)
  12. GetRepoInfo() (*Repository, error)
  13. GetTopics() ([]string, error)
  14. GetMilestones() ([]*Milestone, error)
  15. GetReleases() ([]*Release, error)
  16. GetLabels() ([]*Label, error)
  17. GetIssues(page, perPage int) ([]*Issue, bool, error)
  18. GetComments(commentable Commentable) ([]*Comment, bool, error)
  19. GetAllComments(page, perPage int) ([]*Comment, bool, error)
  20. SupportGetRepoComments() bool
  21. GetPullRequests(page, perPage int) ([]*PullRequest, bool, error)
  22. GetReviews(reviewable Reviewable) ([]*Review, error)
  23. FormatCloneURL(opts MigrateOptions, remoteAddr string) (string, error)
  24. }
  25. // DownloaderFactory defines an interface to match a downloader implementation and create a downloader
  26. type DownloaderFactory interface {
  27. New(ctx context.Context, opts MigrateOptions) (Downloader, error)
  28. GitServiceType() structs.GitServiceType
  29. }
  30. // DownloaderContext has opaque information only relevant to a given downloader
  31. type DownloaderContext interface{}