github

package
v0.0.0-...-873fb03 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ZipUrlPattern       = "https://api.github.com/repos/%s/%s/zipball/%s"      //nolint:stylecheck
	TagsUrlPattern      = "https://api.github.com/repos/%s/%s/releases"        //nolint:stylecheck
	LatestTagUrlPattern = "https://api.github.com/repos/%s/%s/releases/latest" //nolint:stylecheck
	RitchieRepoURL      = "https://github.com/ZupIT/ritchie-cli"
)

Variables

This section is empty.

Functions

func NewRepoInfo

func NewRepoInfo(url string, token string) git.RepoInfo

NewRepoInfo returns the RepoInfo built by repository url Repository url e.g. https://github.com/{{owner}}/{{repo}}

Types

type DefaultRepoInfo

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

func (DefaultRepoInfo) LatestTagUrl

func (in DefaultRepoInfo) LatestTagUrl() string

LatestTagUrl returns the GitHub API URL for get latest tag release https://api.github.com/repos/:owner/:repo/releases/latest

func (DefaultRepoInfo) TagsUrl

func (in DefaultRepoInfo) TagsUrl() string

TagsUrl returns the GitHub API URL for get all tags e.g. https://api.github.com/repos/{{owner}}/{{repo}}/tags

func (DefaultRepoInfo) Token

func (in DefaultRepoInfo) Token() string

func (DefaultRepoInfo) TokenHeader

func (in DefaultRepoInfo) TokenHeader() string

TokenHeader returns the Authorization value formatted for Github API integration e.g. "token some_token"

func (DefaultRepoInfo) ZipUrl

func (in DefaultRepoInfo) ZipUrl(version string) string

ZipUrl returns the GitHub API URL for download zipball repository e.g. https://api.github.com/repos/{{owner}}/{{repo}}/zipball/{{tag-version}}

type RepoManager

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

func NewRepoManager

func NewRepoManager(client *http.Client) RepoManager

func (RepoManager) LatestTag

func (re RepoManager) LatestTag(info git.RepoInfo) (git.Tag, error)

func (RepoManager) Tags

func (re RepoManager) Tags(info git.RepoInfo) (git.Tags, error)

func (RepoManager) Zipball

func (re RepoManager) Zipball(info git.RepoInfo, version string) (io.ReadCloser, error)

Jump to

Keyboard shortcuts

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