ghrepo

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatRemoteURL added in v0.11.1

func FormatRemoteURL(repo Interface, protocol string) string

TODO there is a parallel implementation for non-isolated commands

func FullName

func FullName(r Interface) string

FullName serializes a GitHub repository into an "OWNER/REPO" string

func GenerateRepoURL added in v0.11.1

func GenerateRepoURL(repo Interface, p string, args ...interface{}) string

func IsSame

func IsSame(a, b Interface) bool

IsSame compares two GitHub repositories

func SetDefaultHost added in v1.8.1

func SetDefaultHost(host string)

SetDefaultHost overrides the default GitHub hostname for FromFullName. TODO: remove after FromFullName approach is revisited

Types

type Interface

type Interface interface {
	RepoName() string
	RepoOwner() string
	RepoHost() string
}

Interface describes an object that represents a GitHub repository

func FromFullName

func FromFullName(nwo string) (Interface, error)

FromFullName extracts the GitHub repository information from the following formats: "OWNER/REPO", "HOST/OWNER/REPO", and a full URL.

func FromURL

func FromURL(u *url.URL) (Interface, error)

FromURL extracts the GitHub repository information from a git remote URL

func New

func New(owner, repo string) Interface

New instantiates a GitHub repository from owner and name arguments

func NewWithHost added in v0.11.0

func NewWithHost(owner, repo, hostname string) Interface

NewWithHost is like New with an explicit host name

Jump to

Keyboard shortcuts

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