downloader

package
v0.0.0-...-1133790 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 7, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyPatch

func ApplyPatch(file1, patch1, file2 string) error

ApplyPatch will apply the path to file1, and put the output in file2

func Copy

func Copy(srcFile, dstFile string) error

func CopyDirectory

func CopyDirectory(scrDir, dest string) error
func CopySymLink(source, dest string) error

func CreateIfNotExists

func CreateIfNotExists(dir string, perm os.FileMode) error

func CreatePatch

func CreatePatch(file1, file2 string) error

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 Exists

func Exists(filePath string) bool

func MoveFolder

func MoveFolder(sourcePath, destPath string) error

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 NewGitHubAPI

func NewGitHubAPI(ctx context.Context, token *string) *GitHubAPI

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL