Documentation
¶
Index ¶
Constants ¶
View Source
const ( ContentHost = "https://raw.githubusercontent.com" // ContentURLTpl eg: https://raw.githubusercontent.com/gookit/slog/master/README.md ContentURLTpl = "https://raw.githubusercontent.com/%s/%s/%s" )
Variables ¶
This section is empty.
Functions ¶
func ContentURL ¶
ContentURL for GitHub repo file
Types ¶
type CommitAuthor ¶
type CommitAuthor struct {
Name string `json:"name"`
Email string `json:"email"`
Date string `json:"date"`
}
CommitAuthor info from commit payload.
type CommitDetail ¶
type CommitDetail struct {
Author CommitAuthor `json:"author"`
Message string `json:"message"`
}
CommitDetail info from commit payload.
type CommitInfo ¶
type CommitInfo struct {
SHA string `json:"sha"`
HTMLURL string `json:"html_url"`
Commit CommitDetail `json:"commit"`
}
CommitInfo represents a github commit item.
type GitHub ¶
type GitHub struct {
*gitx.Config
// GitHub 文件, Releases, archive, gist, raw.githubusercontent.com 文件代理加速下载服务.
// eg: https://ghproxy.com
ProxyHost string `json:"proxy_host"`
// Username on https://github.com
Username string `json:"username"`
// Token person token.
Token string `json:"token"`
// BaseApi api url
BaseApi string `json:"base_api"`
}
GitHub config struct
func (*GitHub) CreateAnnotatedTag ¶
func (g *GitHub) CreateAnnotatedTag(in TagCreateInput) (*TagCreateResponse, error)
CreateAnnotatedTag creates annotated tag and tag ref by GitHub Git Database API.
func (*GitHub) GetLatestCommit ¶
func (g *GitHub) GetLatestCommit(repoPath string) (*CommitInfo, error)
GetLatestCommit gets latest commit info on the repository default branch.
type TagCommitRef ¶
TagCommitRef commit info in tag list.
type TagCreateInput ¶
type TagCreateInput struct {
RepoPath string
Version string
Message string
Object string
Type string
Tagger Tagger
}
TagCreateInput for creating an annotated tag by GitHub API.
type TagCreateResponse ¶
type TagCreateResponse struct {
Ref string `json:"ref"`
URL string `json:"url,omitempty"`
Object refObject `json:"object"`
}
TagCreateResponse for created tag ref result.
type TagInfo ¶
type TagInfo struct {
Name string `json:"name"`
Commit TagCommitRef `json:"commit"`
}
TagInfo represents a github tag item.
type TagListInput ¶
TagListInput for querying tag list.
Click to show internal directories.
Click to hide internal directories.