Documentation ¶
Index ¶
- func ApplyPatch(file1, patch1, file2 string) error
- func Copy(srcFile, dstFile string) error
- func CopyDirectory(scrDir, dest string) error
- func CopySymLink(source, dest string) error
- func CreateIfNotExists(dir string, perm os.FileMode) error
- func CreatePatch(file1, file2 string) error
- func Exists(filePath string) bool
- func MoveFolder(sourcePath, destPath string) error
- type Downloader
- type GitHubAPI
- func (g *GitHubAPI) GetLastCommit(repo *github.Repository) (*string, error)
- func (g *GitHubAPI) GetLastCommits(repo []*github.Repository) ([]*string, error)
- func (g *GitHubAPI) GetOrgRepos(org *github.Organization) ([]*github.Repository, error)
- func (g *GitHubAPI) GetOrgs() ([]*github.Organization, error)
- func (g *GitHubAPI) GetRepos() ([]*github.Repository, error)
- func (g *GitHubAPI) RemoveEmptyRepos(repos []*github.Repository) ([]*github.Repository, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyPatch ¶
ApplyPatch will apply the path to file1, and put the output in file2
func CopyDirectory ¶
func CopySymLink ¶
func CreatePatch ¶
CreatePatch will generate a diff between two files, replacing the second file with the patch file from the first this utilises the ridiff command, wrapping it with a process and awaiting
func MoveFolder ¶
Types ¶
type Downloader ¶
type Downloader struct {
// contains filtered or unexported fields
}
func NewDownloader ¶
func NewDownloader(ctx context.Context, token *string) *Downloader
func (*Downloader) DownloadRepo ¶
func (d *Downloader) DownloadRepo(repo *github.Repository, location *string) error
DownloadRepo will download a repo from github, saving it in the preconfigured location, under org/repo-name
func (*Downloader) DownloadRepos ¶
func (d *Downloader) DownloadRepos(repos []*github.Repository, location *string) error
DownloadRepos will download all repos from github, saving them in the preconfigured location, under org/repo-name
func (*Downloader) MigrateRepos ¶
func (d *Downloader) MigrateRepos(new_repos []*github.Repository, existing_path *string, backups_limit int, temp_location *string) error
type GitHubAPI ¶
type GitHubAPI struct {
// contains filtered or unexported fields
}
func (*GitHubAPI) GetLastCommit ¶
func (g *GitHubAPI) GetLastCommit(repo *github.Repository) (*string, error)
get the most recent commit for a repo
func (*GitHubAPI) GetLastCommits ¶
func (g *GitHubAPI) GetLastCommits(repo []*github.Repository) ([]*string, error)
func (*GitHubAPI) GetOrgRepos ¶
func (g *GitHubAPI) GetOrgRepos(org *github.Organization) ([]*github.Repository, error)
GetOrgRepos returns a list of repositories that the user can access from the provided org
func (*GitHubAPI) GetOrgs ¶
func (g *GitHubAPI) GetOrgs() ([]*github.Organization, error)
GetOrgs returns a list of organizations that the user can access
func (*GitHubAPI) GetRepos ¶
func (g *GitHubAPI) GetRepos() ([]*github.Repository, error)
GetRepos returns a list of repositories that the user can access, excluding orgs
func (*GitHubAPI) RemoveEmptyRepos ¶
func (g *GitHubAPI) RemoveEmptyRepos(repos []*github.Repository) ([]*github.Repository, error)
RemoveEmptyRepos removes repositories that have no files available, returning the list otherwise unchanged