types

package
v0.1.17 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Asset

type Asset struct {
	BrowserDownloadUrl string `json:"browser_download_url"`
	Name               string `json:"name"`
}

type Assignee

type Assignee struct {
	BasicUser
	Accept bool `json:"accept"`
}

type BasicEnterprise

type BasicEnterprise struct {
	Id      int    `json:"id"`
	Name    string `json:"name"`
	Path    string `json:"path"`
	HtmlUrl string `json:"html_url"`
}

type BasicIssue

type BasicIssue struct {
	Id        int           `json:"id"`
	Number    string        `json:"number"`
	Title     string        `json:"title"`
	User      BasicUser     `json:"user"`
	State     string        `json:"state"`
	CreatedAt string        `json:"created_at"`
	UpdatedAt string        `json:"updated_at"`
	Body      string        `json:"body"`
	Labels    []BasicLabel  `json:"labels"`
	Assignee  *BasicUser    `json:"assignee"`
	IssueType string        `json:"issue_type"`
	Program   *BasicProgram `json:"program"`
	HtmlUrl   string        `json:"html_url"`
}

BasicIssue 定义了 Issue 的基本结构

type BasicLabel

type BasicLabel struct {
	Id   int    `json:"id"`
	Name string `json:"name"`
}

type BasicProgram

type BasicProgram struct {
	Id          int       `json:"id"`
	Name        string    `json:"name"`
	Description string    `json:"description"`
	Assignee    BasicUser `json:"assignee"`
	Author      BasicUser `json:"author"`
}

type BasicPull

type BasicPull struct {
	Id              int        `json:"id"`
	Title           string     `json:"title"`
	Url             string     `json:"html_url"`
	Number          int        `json:"number"`
	State           string     `json:"state"`
	AssigneesNumber int        `json:"assignees_number"`
	TestersNumber   int        `json:"testers_number"`
	Assignees       []Assignee `json:"assignees"`
	Testers         []Assignee `json:"testers"`
	CreatedAt       string     `json:"created_at"`
	UpdatedAt       string     `json:"updated_at"`
	ClosedAt        string     `json:"closed_at"`
	MergedAt        string     `json:"merged_at"`
	Creator         BasicUser  `json:"user"`
	Head            Reference  `json:"head"`
	Base            Reference  `json:"base"`
	CanMergeCheck   bool       `json:"can_merge_check"`
	Draft           bool       `json:"draft"`
	IsConflict      bool       `json:"is_conflict"`
}

func (*BasicPull) UnmarshalJSON added in v0.1.17

func (p *BasicPull) UnmarshalJSON(data []byte) error

type BasicUser

type BasicUser struct {
	Id        int    `json:"id"`
	Login     string `json:"login"`
	Name      string `json:"name"`
	AvatarUrl string `json:"avatar_url"`
	HtmlUrl   string `json:"html_url"`
	Remark    string `json:"remark"`
}

type CommitAuthorInfo added in v0.1.15

type CommitAuthorInfo struct {
	Name  string `json:"name"`
	Date  string `json:"date"`
	Email string `json:"email"`
}

CommitAuthorInfo is the author/committer info within a commit

type CommitDetail added in v0.1.15

type CommitDetail struct {
	Author    CommitAuthorInfo `json:"author"`
	Committer CommitAuthorInfo `json:"committer"`
	Message   string           `json:"message"`
	Tree      CommitTree       `json:"tree"`
}

CommitDetail is the inner commit object

type CommitParent added in v0.1.15

type CommitParent struct {
	Sha string `json:"sha"`
	Url string `json:"url"`
}

CommitParent is a parent commit reference

type CommitTree added in v0.1.15

type CommitTree struct {
	Sha string `json:"sha"`
	Url string `json:"url"`
}

CommitTree is the tree reference within a commit

type CompareCommit added in v0.1.15

type CompareCommit struct {
	Url         string         `json:"url"`
	Sha         string         `json:"sha"`
	HtmlUrl     string         `json:"html_url"`
	CommentsUrl string         `json:"comments_url"`
	Commit      CommitDetail   `json:"commit"`
	Author      *BasicUser     `json:"author"`
	Committer   *BasicUser     `json:"committer"`
	Parents     []CommitParent `json:"parents"`
}

CompareCommit represents a commit entry in a comparison result

type CompareFile added in v0.1.15

type CompareFile struct {
	Sha        string `json:"sha"`
	Filename   string `json:"filename"`
	Status     string `json:"status"`
	Additions  int    `json:"additions"`
	Deletions  int    `json:"deletions"`
	Changes    int    `json:"changes"`
	BlobUrl    string `json:"blob_url"`
	RawUrl     string `json:"raw_url"`
	ContentUrl string `json:"content_url"`
	Patch      string `json:"patch"`
	Truncated  bool   `json:"truncated"`
}

CompareFile represents a file change in a comparison result

type CompareResult added in v0.1.15

type CompareResult struct {
	BaseCommit      CompareCommit   `json:"base_commit"`
	MergeBaseCommit CompareCommit   `json:"merge_base_commit"`
	Commits         []CompareCommit `json:"commits"`
	Files           []CompareFile   `json:"files"`
	Truncated       bool            `json:"truncated"`
}

CompareResult is the overall response for a branch/tag comparison

type DiffFile added in v0.1.12

type DiffFile struct {
	Sha       string    `json:"sha"`
	Filename  string    `json:"filename"`
	Status    *string   `json:"status"`
	Additions string    `json:"additions"`
	Deletions string    `json:"deletions"`
	BlobUrl   string    `json:"blob_url"`
	RawUrl    string    `json:"raw_url"`
	Patch     PatchInfo `json:"patch"`
}

DiffFile defines the structure for a pull request diff file

type EndpointConfig

type EndpointConfig struct {
	UrlTemplate string
	PathParams  []string
}

type FileContent

type FileContent struct {
	Type    string `json:"type"`
	Size    int    `json:"size"`
	Name    string `json:"name"`
	Path    string `json:"path"`
	Sha     string `json:"sha"`
	Content string `json:"content"`
}

type IssueComment

type IssueComment struct {
	Id        int       `json:"id"`
	Body      string    `json:"body"`
	User      BasicUser `json:"user"`
	CreatedAt string    `json:"created_at"`
	UpdatedAt string    `json:"updated_at"`
}

IssueComment defines the structure for an issue comment

type IssueTypeDetail

type IssueTypeDetail struct {
	Id    int    `json:"id"`
	Title string `json:"title"`
}

type Namespace

type Namespace struct {
	Id      int    `json:"id"`
	Type    string `json:"type"`
	Name    string `json:"name"`
	Path    string `json:"path"`
	HtmlUrl string `json:"html_url"`
}

type Notification

type Notification struct {
	Id         int         `json:"id"`
	Content    string      `json:"content"`
	Type       string      `json:"type"`
	Unread     bool        `json:"unread"`
	Mute       bool        `json:"mute"`
	UpdatedAt  string      `json:"updated_at"`
	Url        string      `json:"url"`
	HtmlUrl    string      `json:"html_url"`
	Actor      BasicUser   `json:"actor"`
	Repository Project     `json:"repository"`
	Subject    Subject     `json:"subject"`
	Namespaces []Namespace `json:"namespaces"`
}

type NotificationResult

type NotificationResult struct {
	TotalCount int            `json:"total_count"`
	List       []Notification `json:"list"`
}

type PagedResponse added in v0.1.7

type PagedResponse[T any] struct {
	TotalCount int `json:"total_count"`
	Data       []T `json:"data"`
}

type PatchInfo added in v0.1.12

type PatchInfo struct {
	Diff        string `json:"diff"`
	NewPath     string `json:"new_path"`
	OldPath     string `json:"old_path"`
	AMode       string `json:"a_mode"`
	BMode       string `json:"b_mode"`
	NewFile     bool   `json:"new_file"`
	RenamedFile bool   `json:"renamed_file"`
	DeletedFile bool   `json:"deleted_file"`
	TooLarge    bool   `json:"too_large"`
}

PatchInfo defines the structure for patch information

type Project

type Project struct {
	Id              int             `json:"id"`
	FullName        string          `json:"full_name"`
	HumanName       string          `json:"human_name"`
	Url             string          `json:"url"`
	Namespace       Namespace       `json:"namespace"`
	Owner           BasicUser       `json:"owner"`
	Assigner        BasicUser       `json:"assigner"`
	Description     string          `json:"description"`
	Private         bool            `json:"private"`
	Public          bool            `json:"public"`
	Internal        bool            `json:"internal"`
	Fork            bool            `json:"fork"`
	SshUrl          string          `json:"ssh_url"`
	Recommend       bool            `json:"recommend"`
	Gvp             bool            `json:"gvp"`
	StargazersCount int             `json:"stargazers_count"`
	ForksCount      int             `json:"forks_count"`
	WatchersCount   int             `json:"watchers_count"`
	DefaultBranch   string          `json:"default_branch"`
	Members         []string        `json:"members"`
	PushedAt        string          `json:"pushed_at"`
	CreatedAt       string          `json:"created_at"`
	UpdatedAt       string          `json:"updated_at"`
	Permission      map[string]bool `json:"permission"`
	Status          string          `json:"status"`
	Enterprise      BasicEnterprise `json:"enterprise"`
}

type PullComment

type PullComment struct {
	Id               int       `json:"id"`
	Body             string    `json:"body"`
	User             BasicUser `json:"user"`
	CreatedAt        string    `json:"created_at"`
	UpdatedAt        string    `json:"updated_at"`
	CommentType      string    `json:"comment_type"`
	CommentId        string    `json:"comment_id"`
	PullUrl          string    `json:"pull_url"`
	OriginalPosition string    `json:"original_position"`
	Path             string    `json:"path"`
	Position         string    `json:"position"`
	CommitId         string    `json:"commit_id"`
	OriginalCommitId string    `json:"original_commit_id"`
	InReplyToId      int       `json:"in_reply_to_id"`
	Url              string    `json:"url"`
}

PullComment defines the structure for a pull request comment

type Reference

type Reference struct {
	Ref   string `json:"ref"`
	Label string `json:"label"`
	Sha   string `json:"sha"`
}

type Release

type Release struct {
	Id              int       `json:"id"`
	Author          BasicUser `json:"author"`
	Name            string    `json:"name"`
	Body            string    `json:"body"`
	Prerelease      bool      `json:"prerelease"`
	TagName         string    `json:"tag_name"`
	TargetCommitish string    `json:"target_commitish"`
	CreatedAt       string    `json:"created_at"`
	Assets          []Asset   `json:"assets"`
}

type SearchProject added in v0.1.7

type SearchProject struct {
	Id          int      `json:"id"`
	Name        string   `json:"name"`
	Url         string   `json:"url"`
	Description string   `json:"description"`
	Stars       int      `json:"stars"`
	Forks       int      `json:"forks"`
	Languages   []string `json:"languages"`
	LastPushAt  string   `json:"last_push_at"`
	CreatedAt   string   `json:"created_at"`
	UpdatedAt   string   `json:"updated_at"`
}

type Subject

type Subject struct {
	Title            string `json:"title"`
	Url              string `json:"url"`
	LatestCommentUrl string `json:"latest_comment_url"`
	Type             string `json:"type"`
}

Jump to

Keyboard shortcuts

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