ghrepo

package
v2.41.0 Latest Latest
Warning

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

Go to latest
Published: May 19, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatRemoteURL

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

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

func IsSame

func IsSame(a, b Interface) bool

IsSame compares two GitHub repositories

Types

type Interface

type Interface interface {
	RepoName() string
	RepoOwner() string
	RepoHost() string
	RepoURL() 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 FromFullNameWithHost

func FromFullNameWithHost(nwo, fallbackHost string) (Interface, error)

FromFullNameWithHost is like FromFullName that defaults to a specific host for values that don't explicitly include a hostname.

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

func NewWithHost(owner, repo, hostname string, fullURL string) Interface

NewWithHost is like New with an explicit host name

type Respository

type Respository struct {
	// contains filtered or unexported fields
}

func NewRepoFromHost

func NewRepoFromHost(u string, defaultHost string) (*Respository, error)

func (*Respository) Host

func (r *Respository) Host() string

func (*Respository) Name

func (r *Respository) Name() string

func (*Respository) Owner

func (r *Respository) Owner() string

func (*Respository) URL

func (r *Respository) URL() string

Jump to

Keyboard shortcuts

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