Documentation
¶
Overview ¶
Package issue to address issue create, list, show, assign, close
Index ¶
- func IssueAPIBaseURL(originURL string, issueConfig *IssueConfig) (err error)
- func PrintIssue(issue Issue, detailed bool)
- func ReadBodyFromStdinOrFile(filePath string) (string, error)
- type CreateIssueOptions
- type Issue
- func AssignIssue(ctx context.Context, number int, username string) (issue *Issue, err error)
- func CloseIssue(ctx context.Context, number int) (issue *Issue, err error)
- func CreateIssue(ctx context.Context, opts CreateIssueOptions) (*Issue, error)
- func ListIssues(ctx context.Context, state string) ([]Issue, error)
- func ReopenIssue(ctx context.Context, number int) (issue *Issue, err error)
- func ShowIssue(ctx context.Context, number int) (*Issue, error)
- func UpdateIssue(ctx context.Context, opts UpdateIssueOptions) (*Issue, error)
- type IssueAPIError
- type IssueConfig
- type Label
- type RawIssue
- type RawUser
- type UpdateIssueOptions
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IssueAPIBaseURL ¶
func IssueAPIBaseURL(originURL string, issueConfig *IssueConfig) (err error)
Types ¶
type Issue ¶
type Issue struct {
ID int
Number string
State string
Title string
Body string
CreatedAt time.Time
UpdatedAt time.Time
ClosedAt time.Time
Labels []Label
Assignee *User
User User
}
Issue 处理后的issue数据结构
func AssignIssue ¶
AssignIssue 分配issue给用户
func CloseIssue ¶
CloseIssue 关闭issue
func ListIssues ¶
ListIssues 列出issues
func ReopenIssue ¶
ReopenIssue 重新打开issue
func ShowIssue ¶
ShowIssue 显示单个issue详情
type IssueAPIError ¶
IssueAPIError 表示issue API调用错误
func (*IssueAPIError) Error ¶
func (e *IssueAPIError) Error() string
type IssueConfig ¶
type IssueConfig struct {
APIHost string
BaseURL string
Token string
Owner string
Repo string // 仓库名称,用于GitCode API请求体
}
IssueConfig 包含issue操作的配置信息
func GetIssueConfig ¶
func GetIssueConfig(ctx context.Context) (issueConfig *IssueConfig, err error)
GetIssueConfig 获取issue配置信息
type Label ¶
type Label struct {
ID int `json:"id"`
Name string `json:"name"`
Color string `json:"color"`
Description string `json:"description"`
}
Label 表示issue的标签
type RawIssue ¶
type RawIssue struct {
ID json.RawMessage `json:"id"`
Number string `json:"number"`
State string `json:"state"`
Title string `json:"title"`
Body string `json:"body"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
ClosedAt string `json:"closed_at"`
Labels []Label `json:"labels"`
Assignee *RawUser `json:"assignee"`
User RawUser `json:"user"`
}
RawIssue 用于接收原始JSON数据
type RawUser ¶
type RawUser struct {
ID json.RawMessage `json:"id"`
Login string `json:"login"`
Name string `json:"name"`
AvatarURL string `json:"avatar_url"`
}
RawUser 原始用户数据
type UpdateIssueOptions ¶
Source Files
¶
- issue.go
- issue_assign.go
- issue_close.go
- issue_create.go
- issue_lib.go
- issue_list.go
- issue_reopen.go
- issue_show.go
- issue_update.go
Click to show internal directories.
Click to hide internal directories.