change

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CmdChange = &cobra.Command{
	Use:   "changelog",
	Short: "获取phantasm变更日志",
	Long:  `获取phantasm发布版本或提交信息。例如:phantasm changelog dev 或 phantasm changelog {version}`,
	Run:   run,
}

CmdChange 是phantasm变更日志工具

Functions

func ParseCommitsInfo

func ParseCommitsInfo(info []CommitInfo) string

ParseCommitsInfo 解析提交信息生成Markdown

func ParseGithubURL

func ParseGithubURL(url string) (owner string, repo string)

ParseGithubURL 解析GitHub URL获取所有者和仓库名

func ParseReleaseInfo

func ParseReleaseInfo(info ReleaseInfo) string

ParseReleaseInfo 解析发布信息生成文本

Types

type CommitInfo

type CommitInfo struct {
	Commit struct {
		Message string `json:"message"`
	} `json:"commit"`
}

CommitInfo 保存提交信息结构

type ErrorInfo

type ErrorInfo struct {
	Message string `json:"message"`
}

ErrorInfo 保存错误信息结构

type GithubAPI

type GithubAPI struct {
	Owner string
	Repo  string
	Token string
}

GithubAPI 用于请求GitHub API的结构

func (*GithubAPI) GetCommitsInfo

func (g *GithubAPI) GetCommitsInfo() []CommitInfo

GetCommitsInfo 获取phantasm提交信息

func (*GithubAPI) GetReleaseInfo

func (g *GithubAPI) GetReleaseInfo(version string) ReleaseInfo

GetReleaseInfo 获取phantasm发布信息

type ReleaseInfo

type ReleaseInfo struct {
	Author struct {
		Login string `json:"login"`
	} `json:"author"`
	PublishedAt string `json:"published_at"`
	Body        string `json:"body"`
	HTMLURL     string `json:"html_url"`
}

ReleaseInfo 保存发布信息结构

Jump to

Keyboard shortcuts

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