Version: v0.0.0-...-f5432ee Latest Latest

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

Go to latest
Published: Apr 14, 2021 License: MIT Imports: 11 Imported by: 0



TODO: rename this package to avoid clash with stdlib



This section is empty.


This section is empty.


This section is empty.


type Remote

type Remote struct {
	Repo ghrepo.Interface

Remote represents a git remote mapped to a GitHub repository

func (Remote) RepoHost

func (r Remote) RepoHost() string

RepoHost is the GitHub hostname that the remote points to

func (Remote) RepoName

func (r Remote) RepoName() string

RepoName is the name of the GitHub repository

func (Remote) RepoOwner

func (r Remote) RepoOwner() string

RepoOwner is the name of the GitHub account that owns the repo

type Remotes

type Remotes []*Remote

Remotes represents a set of git remotes

func TranslateRemotes

func TranslateRemotes(gitRemotes git.RemoteSet, urlTranslate func(*url.URL) *url.URL) (remotes Remotes)

TODO: accept an interface instead of git.RemoteSet

func (Remotes) FilterByHosts

func (r Remotes) FilterByHosts(hosts []string) Remotes

Filter remotes by given hostnames, maintains original order

func (Remotes) FindByName

func (r Remotes) FindByName(names ...string) (*Remote, error)

FindByName returns the first Remote whose name matches the list

func (Remotes) FindByRepo

func (r Remotes) FindByRepo(owner, name string) (*Remote, error)

FindByRepo returns the first Remote that points to a specific GitHub repository

func (Remotes) Len

func (r Remotes) Len() int

func (Remotes) Less

func (r Remotes) Less(i, j int) bool

func (Remotes) Swap

func (r Remotes) Swap(i, j int)

type ResolvedRemotes

type ResolvedRemotes struct {
	// contains filtered or unexported fields

func ResolveRemotesToRepos

func ResolveRemotesToRepos(remotes Remotes, client *api.Client, base string) (*ResolvedRemotes, error)

func (*ResolvedRemotes) BaseRepo

func (*ResolvedRemotes) HeadRepos

func (r *ResolvedRemotes) HeadRepos() ([]*api.Repository, error)

func (*ResolvedRemotes) RemoteForRepo

func (r *ResolvedRemotes) RemoteForRepo(repo ghrepo.Interface) (*Remote, error)

RemoteForRepo finds the git remote that points to a repository

Jump to

Keyboard shortcuts

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