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