Documentation ¶
Index ¶
- func BranchArchive(repo Interface, branch string) string
- func DownloadAsset(httpClient *http.Client, asset ReleaseAsset, destPath string) error
- func FormatRemoteURL(repo Interface, protocol string) string
- func FullName(r Interface) string
- func GenerateRepoURL(repo Interface, p string, args ...interface{}) string
- func HasScript(httpClient *http.Client, repo Interface) (hs bool, err error)
- func IsSame(a, b Interface) bool
- func SHAArchive(repo Interface, sha string) string
- func SetDefaultHost(host string)
- func TagArchive(repo Interface, tag string) string
- type Interface
- func FromFullName(nwo string) (Interface, error)
- func FromFullNameWithHost(nwo, fallbackHost string) (Interface, error)
- func FromURL(u *url.URL) (Interface, error)
- func New(owner, repo string) Interface
- func NewFromURL(path string) (Interface, error)
- func NewWithHost(owner, repo, hostname string) Interface
- type Release
- type ReleaseAsset
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BranchArchive ¶
BranchArchive returns the archive URL of a branch given an interface and a branch
func DownloadAsset ¶
func DownloadAsset(httpClient *http.Client, asset ReleaseAsset, destPath string) error
DownloadAsset downloads a single asset to the given file path.
func FormatRemoteURL ¶
TODO there is a parallel implementation for non-isolated commands
func GenerateRepoURL ¶
func SHAArchive ¶
SHAArchive returns the archive URL of a given Git SHA given an Interface and a SHA
func SetDefaultHost ¶
func SetDefaultHost(host string)
SetDefaultHost overrides the default GitHub hostname for FromFullName. TODO: remove after FromFullName approach is revisited
func TagArchive ¶
TagArchive returns the archive URL of a tag given an Interface and a tag
Types ¶
type Interface ¶
Interface describes an object that represents a GitHub repository
func FromFullName ¶
FromFullName extracts the GitHub repository information from the following formats: "OWNER/REPO", "HOST/OWNER/REPO", and a full URL.
func FromFullNameWithHost ¶
FromFullNameWithHost is like FromFullName that defaults to a specific host for values that don't explicitly include a hostname.
func NewFromURL ¶
NewFromURL parses a given GitHub url and returns the populated Interface
func NewWithHost ¶
NewWithHost is like New with an explicit host name
type Release ¶
type Release struct { Tag string `json:"tag_name"` Assets []ReleaseAsset }