model

package
v0.142.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package model is the pure-domain layer of go-git-platform: the shared entity types and value vocabularies every layer above speaks in — repositories, change requests, issues, labels, milestones, reviews, webhooks, search results, notifications, gists, releases, CI job logs, migrations, commit statuses and deployments — plus the Platform enumeration and its seven platform constants.

Layering

model is a leaf: it imports nothing from this repository (standard library only). provider (the contract seam), runtime (the machines), adapter (the platform implementations), contracttest and downstream consumers all reference these types as model.Xxx; nothing here may import any of them (spec §4.1 edge table; enforced by internal/layering). Parameter/option structs (XxxOptions) and the capability interfaces stay in provider — model holds only the entities platforms return and events carry.

Index

Constants

View Source
const (
	ReactionPlusOne  = "+1"
	ReactionMinusOne = "-1"
	ReactionLaugh    = "laugh"
	ReactionConfused = "confused"
	ReactionHeart    = "heart"
	ReactionHooray   = "hooray"
	ReactionRocket   = "rocket"
	ReactionEyes     = "eyes"
)

Standard emoji identifiers used across all platforms. GitLab maps these to its award-emoji names internally (e.g. +1 ↔ thumbsup).

Variables

This section is empty.

Functions

func ExtractMentions

func ExtractMentions(body string) []string

ExtractMentions returns the deduplicated list of @usernames found in body. Email addresses (foo@bar.com) are excluded by the leading non-word-char guard. Mentions inside URLs (e.g. `[@user](https://example.com/@user)`) are also excluded. The returned order follows first occurrence.

尾部标点剥离(issue #145):用户名字符类含 '.'/'-'(GitLab 的 first.last 形态),正文最常见的 "cc @alice." 会把句号吞进用户名——解析出 "alice." 而非合法账号 "alice",真实用户被漏掉。合法账号名不以 '.'/'-' 结尾 (GitHub/GitLab 注册规则同此),只裁尾部、保留内部点号(@first.last 不受影响);"@alice..." 三连句号裁成 "alice"。

Types

type BranchProtection

type BranchProtection struct {
	BranchName               string `json:"branch_name"`
	RequiredApprovingReviews int    `json:"required_approving_reviews"`
	RequiredStatusChecks     bool   `json:"required_status_checks"`
	AllowForcePushes         bool   `json:"allow_force_pushes"`
	AllowDeletions           bool   `json:"allow_deletions"`
}

BranchProtection represents a branch protection rule.

type CRComment

type CRComment struct {
	ID        int64     `json:"id"`
	Body      string    `json:"body"`
	Author    *CRUser   `json:"author"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

CRComment represents a comment on a change request.

func (*CRComment) Mentions

func (c *CRComment) Mentions() []string

Mentions returns the deduplicated @usernames found in the comment body.

type CRCommit

type CRCommit struct {
	SHA       string    `json:"sha"`
	Message   string    `json:"message"`
	Author    *CRUser   `json:"author"`
	CreatedAt time.Time `json:"created_at"`
}

CRCommit represents a commit in a change request.

type CRState

type CRState string

CRState represents the state of a change request.

const (
	CRStateOpened CRState = "opened"
	CRStateMerged CRState = "merged"
	CRStateClosed CRState = "closed"
)

type CRUser

type CRUser struct {
	ID        int64  `json:"id"`
	Username  string `json:"username"`
	Name      string `json:"name"`
	AvatarURL string `json:"avatar_url"`
}

CRUser represents a user on a platform.

type ChangeRequest

type ChangeRequest struct {
	ID           int64   `json:"id"`
	Number       string  `json:"number"`
	Title        string  `json:"title"`
	Description  string  `json:"description"`
	State        CRState `json:"state"`
	SourceBranch string  `json:"source_branch"`
	TargetBranch string  `json:"target_branch"`
	// HeadSHA is the SHA of the source-branch tip.
	// BaseSHA is the diff base: the merge-base (common ancestor) where GitLab/TencentCode
	// expose it via diff_refs.base_sha. GitHub/Gitea do not expose a distinct merge base in
	// webhook payloads, so BaseSHA there is the target-branch tip (equivalent to StartSHA).
	// StartSHA is the SHA of the target-branch tip at event time (GitLab diff_refs.start_sha).
	// On GitHub/Gitea it equals BaseSHA since no separate value is exposed.
	HeadSHA  string `json:"head_sha,omitempty"`
	BaseSHA  string `json:"base_sha,omitempty"`
	StartSHA string `json:"start_sha,omitempty"`
	// Draft reports the work-in-progress / draft state uniformly across platforms
	// (GitHub pr.draft, Gitea draft, GitLab/TencentCode work_in_progress).
	Draft       bool      `json:"draft"`
	Author      *CRUser   `json:"author"`
	Assignees   []*CRUser `json:"assignees,omitempty"`
	Reviewers   []*CRUser `json:"reviewers"`
	Labels      []string  `json:"labels"`
	MergeStatus string    `json:"merge_status"`
	WebURL      string    `json:"web_url"`
	CreatedAt   time.Time `json:"created_at"`
	UpdatedAt   time.Time `json:"updated_at"`
}

ChangeRequest represents a pull request or merge request. Number is the platform's change-request identifier as a string (numeric on every current platform), mirroring Issue.Number.

type ChangedFile

type ChangedFile struct {
	OldPath   string `json:"old_path"`
	NewPath   string `json:"new_path"`
	Diff      string `json:"diff"`
	Additions int    `json:"additions"`
	Deletions int    `json:"deletions"`
	IsNew     bool   `json:"new_file"`
	IsDeleted bool   `json:"deleted_file"`
	IsRenamed bool   `json:"renamed_file"`
	IsBinary  bool   `json:"binary"`
}

ChangedFile represents a file changed in a change request.

type Collaborator

type Collaborator struct {
	ID         int64   `json:"id"`
	Username   string  `json:"username"`
	Permission string  `json:"permission,omitempty"`
	User       *CRUser `json:"user,omitempty"`
}

Collaborator represents a repository collaborator.

type CommitInfo

type CommitInfo struct {
	SHA       string    `json:"sha"`
	Message   string    `json:"message"`
	Author    *CRUser   `json:"author"`
	Committer *CRUser   `json:"committer"`
	CreatedAt time.Time `json:"created_at"`
	Additions int       `json:"additions"`
	Deletions int       `json:"deletions"`
}

CommitInfo represents a commit.

type CommitStatus

type CommitStatus struct {
	State       CommitStatusState `json:"state"`
	Context     string            `json:"context"`
	Description string            `json:"description,omitempty"`
	TargetURL   string            `json:"target_url,omitempty"`
}

CommitStatus is one status reported on a commit, unified across platforms. State is normalized via NormalizeCommitStatusState.

type CommitStatusState

type CommitStatusState string

CommitStatusState is the unified state vocabulary for commit statuses. It covers the union of the platforms' verbs: GitHub (error/failure/pending/success), GitLab (pending/running/success/ failed/canceled and pipeline pre-states), Gitea/Forgejo (pending/success/error/failure/warning), and the GitHub-shaped verbs spoken by GitCode, Gitee (via check-run conclusions) and Tencent Code.

const (
	// CommitStatusPending is the "not finished yet" state: the check is
	// queued or running. This is the only non-terminal state.
	CommitStatusPending CommitStatusState = "pending"
	// CommitStatusRunning is an alias of CommitStatusPending kept as a
	// distinct constant so callers can surface GitLab-style running
	// states verbatim; CombineCommitStatusStates treats it as pending.
	CommitStatusRunning CommitStatusState = "running"
	// CommitStatusSuccess is the terminal "passed" state.
	CommitStatusSuccess CommitStatusState = "success"
	// CommitStatusFailure is the terminal "failed" state.
	CommitStatusFailure CommitStatusState = "failure"
	// CommitStatusError is the terminal "errored before/without a run"
	// state. It is terminal like CommitStatusFailure but distinct so
	// infrastructure breakage stays tellable from test breakage.
	CommitStatusError CommitStatusState = "error"
	// CommitStatusCanceled is the terminal "canceled" state (GitLab).
	CommitStatusCanceled CommitStatusState = "canceled"
)

func CombineCommitStatusStates

func CombineCommitStatusStates(states []CommitStatusState) CommitStatusState

CombineCommitStatusStates folds per-context states into the single combined state of a commit, using the same precedence as GitHub's combined status: any error wins, then failure, then canceled; any pending/running keeps the commit pending; only an all-success set is success. An empty set is pending — a commit with no reported statuses has nothing to gate on yet.

func NormalizeCommitStatusState

func NormalizeCommitStatusState(state string) CommitStatusState

NormalizeCommitStatusState maps a platform's raw status verb onto the unified CommitStatusState vocabulary. Unknown verbs normalize to CommitStatusPending so that unrecognised in-flight states keep callers waiting instead of concluding early; platform backends map their own verbs through this helper before returning CommitStatus values.

Gitea/Forgejo "warning" (build passed with warnings) normalizes to success: it is a terminal passing outcome, and merge gates treat it as such on the platform itself.

func (CommitStatusState) Terminal

func (s CommitStatusState) Terminal() bool

Terminal reports whether the state is a final outcome: success, failure, error, or canceled — anything but the pending/running family and the empty state.

type CompareResult

type CompareResult struct {
	Commits      []*CommitInfo  `json:"commits"`
	Files        []*ChangedFile `json:"files"`
	TotalCommits int            `json:"total_commits"`
	AheadBy      int            `json:"ahead_by"`
	BehindBy     int            `json:"behind_by"`
	// FilesTruncated reports that the Files list is KNOWN to be incomplete
	// because the platform caps the compare-diff file list (issue #77:
	// GitHub serves at most 300 changed files per comparison, first page
	// only, with no pagination line to exhaust). A compare-based audit or
	// sync must treat Files as a prefix, never as the full changeset, when
	// this is true. Backends without a platform cap (or that paginate the
	// file list fully) always leave it false.
	FilesTruncated bool `json:"files_truncated,omitempty"`
}

CompareResult represents the result of comparing two commits.

type Contributor

type Contributor struct {
	Username      string `json:"username"`
	Contributions int    `json:"contributions"`
}

Contributor represents a repository contributor.

type DeployKey

type DeployKey struct {
	ID       int64  `json:"id"`
	Title    string `json:"title"`
	Key      string `json:"key"`
	ReadOnly bool   `json:"read_only"`
}

DeployKey represents a deploy key on a repository.

type Deployment

type Deployment struct {
	ID          int64               `json:"id"`
	SHA         string              `json:"sha,omitempty"`
	Ref         string              `json:"ref,omitempty"`
	Environment string              `json:"environment,omitempty"`
	Description string              `json:"description,omitempty"`
	Creator     string              `json:"creator,omitempty"`
	CreatedAt   time.Time           `json:"created_at,omitempty"`
	URL         string              `json:"url,omitempty"`
	Statuses    []*DeploymentStatus `json:"statuses,omitempty"`
}

Deployment is one record in a platform's deployment history.

type DeploymentStatus

type DeploymentStatus struct {
	State          string    `json:"state"`
	Description    string    `json:"description,omitempty"`
	LogURL         string    `json:"log_url,omitempty"`
	EnvironmentURL string    `json:"environment_url,omitempty"`
	CreatedAt      time.Time `json:"created_at,omitempty"`
}

DeploymentStatus is one state report on a deployment (the state machine vocabulary is the GitHub deployments one: pending → in_progress/queued → success/failure/error/canceled/inactive).

type EventRepo

type EventRepo struct {
	ID       int64  `json:"id"`
	FullName string `json:"full_name"`
	Owner    string `json:"owner"`
	Name     string `json:"name"`
}

EventRepo represents the repository in a webhook event.

type FileResult

type FileResult struct {
	SHA       string `json:"sha,omitempty"`
	CommitSHA string `json:"commit_sha,omitempty"`
}

FileResult is the result of a file operation.

type Gist

type Gist struct {
	ID          string              `json:"id"`
	Description string              `json:"description"`
	Public      bool                `json:"public"`
	HTMLURL     string              `json:"html_url"`
	CreatedAt   time.Time           `json:"created_at"`
	UpdatedAt   time.Time           `json:"updated_at"`
	Files       map[string]GistFile `json:"files"`
}

Gist GitHub Gist 元数据。json tag 与 GitHub API 对齐,便于消费方直接 序列化落盘备份(下游 BackupGists 即整体 json.MarshalIndent)。

type GistFile

type GistFile struct {
	Filename string `json:"filename"`
	Language string `json:"language"`
	RawURL   string `json:"raw_url"`
	Size     int64  `json:"size"`
	Content  string `json:"content"`
}

GistFile 单个 gist 文件的元数据与内容。json tag 与 GitHub /gists 响应对齐, 与消费方(git-sync-service githubapi.Gist 内嵌结构)字段保持兼容。

type Issue

type Issue struct {
	ID        int64         `json:"id"`
	Number    string        `json:"number"`
	Title     string        `json:"title"`
	Body      string        `json:"body"`
	State     IssueState    `json:"state"`
	Author    *CRUser       `json:"author,omitempty"`
	Labels    []string      `json:"labels,omitempty"`
	Assignees []string      `json:"assignees,omitempty"`
	Milestone *MilestoneRef `json:"milestone,omitempty"`
	WebURL    string        `json:"web_url,omitempty"`
	CreatedAt time.Time     `json:"created_at"`
	UpdatedAt time.Time     `json:"updated_at"`
	ClosedAt  *time.Time    `json:"closed_at,omitempty"`
	// IsPullRequest 标记这条"issue"其实是 PR。
	//
	// **GitHub 的 issue 列表端点会把 PR 一起返回**(同一条记录既是 issue 也是 PR),
	// 不标记的话消费方没法把两者分开 ⇒ 同一个 PR 既进 issues 快照又进
	// pull_requests 快照,而且**占掉 issue 的数量预算**(默认 500)
	// ⇒ PR 多的仓里真实 issue 可能整批落在预算之外,快照缺项且无任何告警。
	//
	// Gitea/Forgejo 家族的列表端点有 type=issues 过滤(本来就不含 PR),
	// GitLab 的 issues 端点也不含 MR ⇒ 只有 GitHub 需要这个标记。
	IsPullRequest bool `json:"is_pull_request,omitempty"`
}

Issue represents an issue on a platform. Number is the platform's issue identifier as a string (numeric on every current platform except Gitee, whose identifiers are alphanumeric).

type IssueComment

type IssueComment struct {
	ID        int64     `json:"id"`
	Body      string    `json:"body"`
	Author    *CRUser   `json:"author,omitempty"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

IssueComment represents a comment on an issue.

func (*IssueComment) Mentions

func (c *IssueComment) Mentions() []string

Mentions returns the deduplicated @usernames found in the comment body.

type IssueLabel

type IssueLabel struct {
	ID    int64  `json:"id"`
	Name  string `json:"name"`
	Color string `json:"color,omitempty"`
}

IssueLabel represents a label on a repository.

type IssueState

type IssueState string

IssueState represents the state of an issue.

const (
	IssueStateOpen   IssueState = "open"
	IssueStateClosed IssueState = "closed"
)

type JobLog

type JobLog struct {
	Name      string `json:"name"`
	Stage     string `json:"stage"`
	WebURL    string `json:"web_url,omitempty"`
	Trace     string `json:"trace"` // 失败日志尾部(后端截断,量级 ~20KB)
	Truncated bool   `json:"truncated"`
}

JobLog is one failed CI job's identifying metadata plus the tail of its execution log, sized for LLM consumption rather than archival.

type Label

type Label struct {
	ID          int64  `json:"id"`
	Name        string `json:"name"`
	Color       string `json:"color,omitempty"`
	Description string `json:"description,omitempty"`
}

Label represents a repository label. Color is canonicalized to 6-digit hex without a leading '#' (e.g. "ff0000"); backends add the '#' when a platform requires it (GitLab, Gitea, Forgejo) and strip it on the way in.

type MergeDiff

type MergeDiff struct {
	Files    []*ChangedFile
	TotalAdd int
	TotalDel int
	RawDiff  string
}

MergeDiff represents the diff of a change request.

type MigrationInfo

type MigrationInfo struct {
	ID    int64  `json:"id"`
	State string `json:"state"`
	// ArchiveURL 归档下载地址(仅当 state 为 exported 时可用)。
	ArchiveURL string `json:"archive_url"`
}

MigrationInfo 迁移任务状态。json tag 与 GitHub 迁移 API 响应对齐。

type Milestone

type Milestone struct {
	Number      string         `json:"number"`
	Title       string         `json:"title"`
	Description string         `json:"description"`
	State       MilestoneState `json:"state"`
	DueOn       *time.Time     `json:"due_on,omitempty"`
}

Milestone represents a repository milestone. Number carries the platform's milestone addressing identifier as a string — the same value MilestoneRef.Number uses and MilestoneManager methods accept: the milestone number on GitHub, the platform milestone ID on GitLab, Gitea, Forgejo, GitCode, and Tencent Code, and the milestone serial number on Gitee (see MilestoneManager for the per-platform truth).

type MilestoneRef

type MilestoneRef struct {
	Number string `json:"number"`
	Title  string `json:"title,omitempty"`
}

MilestoneRef references a milestone from an issue. Number carries the platform's milestone addressing identifier as a string: the milestone *number* on GitHub, the platform milestone *ID* on GitLab, Gitea, Forgejo, GitCode, and Tencent Code (whose write endpoints take exactly that identifier, so per-platform round-trips hold), and Gitee's milestone *serial number* (the "number" field of Gitee's milestone payload — the identifier Gitee's own issue and milestone write endpoints take; the SDK model exposes no id). This is the same identifier Milestone.Number exposes and MilestoneManager methods accept, so refs round-trip through the milestone manager on the platform they came from.

type MilestoneState

type MilestoneState string

MilestoneState represents the state of a milestone.

const (
	MilestoneStateOpen   MilestoneState = "open"
	MilestoneStateClosed MilestoneState = "closed"
)

type NormalizedEvent

type NormalizedEvent struct {
	ID        string         `json:"id"`
	Type      string         `json:"type"`
	Source    Platform       `json:"source"`
	Timestamp time.Time      `json:"timestamp"`
	Actor     *CRUser        `json:"actor"`
	Repo      *EventRepo     `json:"repo"`
	CR        *ChangeRequest `json:"cr,omitempty"`
	// Issue is set for issue.* events and for comments made on issues;
	// Comment carries the comment body for comment.* events. A comment on
	// a change request populates CR instead of (or alongside) nothing.
	Issue      *Issue          `json:"issue,omitempty"`
	Comment    *IssueComment   `json:"comment,omitempty"`
	Branch     string          `json:"branch,omitempty"`
	Tag        string          `json:"tag,omitempty"`
	CommitSHA  string          `json:"commit_sha,omitempty"`
	Action     string          `json:"action,omitempty"`
	RawPayload json.RawMessage `json:"raw_payload"`
}

NormalizedEvent represents a normalized webhook event from any platform.

type Notification

type Notification struct {
	ID        string              `json:"id"`
	Unread    bool                `json:"unread"`
	Reason    string              `json:"reason"`
	Subject   NotificationSubject `json:"subject"`
	Repo      *EventRepo          `json:"repo,omitempty"`
	UpdatedAt time.Time           `json:"updated_at"`
}

Notification represents a single notification from a user's inbox.

type NotificationSubject

type NotificationSubject struct {
	Title string `json:"title"`
	Type  string `json:"type"` // "Issue", "PullRequest", "Commit", etc.
	URL   string `json:"url"`
}

NotificationSubject describes the resource that triggered the notification.

type Platform

type Platform string

Platform represents a Git hosting platform.

const (
	PlatformGitLab      Platform = "gitlab"
	PlatformGitHub      Platform = "github"
	PlatformGitea       Platform = "gitea"
	PlatformGitee       Platform = "gitee"
	PlatformForgejo     Platform = "forgejo"
	PlatformTencentCode Platform = "tencent_code"
	PlatformGitCode     Platform = "gitcode"
)

type PlatformBranch

type PlatformBranch struct {
	Name string `json:"name"`
}

PlatformBranch represents a branch on a platform.

type PlatformRepo

type PlatformRepo struct {
	ID            int64    `json:"id"`
	FullName      string   `json:"full_name"`
	Name          string   `json:"name"`
	Owner         string   `json:"owner"`
	Description   string   `json:"description"`
	CloneURL      string   `json:"clone_url"`
	SSHURL        string   `json:"ssh_url"`
	DefaultBranch string   `json:"default_branch"`
	Private       bool     `json:"private"`
	Platform      Platform `json:"platform"`
	// 仓库元数据(用于导入过滤:排除 archived/fork、按 star/语言过滤)
	Archived bool   `json:"archived,omitempty"`
	Fork     bool   `json:"fork,omitempty"`
	Stars    int    `json:"stars,omitempty"`
	Language string `json:"language,omitempty"`
}

PlatformRepo represents a repository on a platform.

type PlatformWebhook

type PlatformWebhook struct {
	ID     int64    `json:"id"`
	URL    string   `json:"url"`
	Events []string `json:"events"`
}

PlatformWebhook represents a webhook on a platform.

type Reaction

type Reaction struct {
	ID    int64   `json:"id"`
	Emoji string  `json:"emoji"`
	User  *CRUser `json:"user,omitempty"`
}

Reaction represents an emoji reaction on an issue or comment.

type ReleaseAsset

type ReleaseAsset struct {
	ID                 int64  `json:"id"`
	Name               string `json:"name"`
	Size               int64  `json:"size"`
	ContentType        string `json:"content_type"`
	BrowserDownloadURL string `json:"browser_download_url"`
	URL                string `json:"url"`
}

ReleaseAsset Release 附件元数据。json tag 与 GitHub API 对齐,与消费方 (git-sync-service githubapi.ReleaseAsset)字段保持兼容,Size 放大到 int64。

type ReleaseInfo

type ReleaseInfo struct {
	ID          int64     `json:"id"`
	TagName     string    `json:"tag_name"`
	Title       string    `json:"title"`
	Body        string    `json:"body"`
	URL         string    `json:"url"`
	Draft       bool      `json:"draft"`
	Prerelease  bool      `json:"prerelease"`
	CreatedAt   time.Time `json:"created_at"`
	PublishedAt time.Time `json:"published_at"`
	// Assets 发布附件元数据(仅声明 ReleaseAssets 能力的后端填充)。
	Assets []*ReleaseAsset `json:"assets,omitempty"`
}

ReleaseInfo represents a release.

type Review

type Review struct {
	ID          int64       `json:"id"`
	User        string      `json:"user"`
	State       ReviewState `json:"state"`
	Body        string      `json:"body"`
	SubmittedAt time.Time   `json:"submitted_at"`
}

Review represents a code review on a change request (the ReviewManager view; ReviewResult above is the create-call response).

type ReviewComment

type ReviewComment struct {
	Path      string `json:"path"`
	Body      string `json:"body"`
	Line      int    `json:"line,omitempty"`
	StartLine int    `json:"start_line,omitempty"`
	EndLine   int    `json:"end_line,omitempty"`
	Side      string `json:"side,omitempty"`
}

ReviewComment is a single inline comment in a code review.

func (*ReviewComment) Mentions

func (c *ReviewComment) Mentions() []string

Mentions returns the deduplicated @usernames found in the comment body.

type ReviewCommentResult

type ReviewCommentResult struct {
	Path       string `json:"path,omitempty"`
	Line       int    `json:"line,omitempty"`
	ExternalID string `json:"external_id,omitempty"`
	Error      string `json:"error,omitempty"`
}

ReviewCommentResult is the result of posting a single inline comment.

type ReviewResult

type ReviewResult struct {
	ID       string                `json:"id"`
	Body     string                `json:"body,omitempty"`
	HTMLURL  string                `json:"html_url,omitempty"`
	User     *CRUser               `json:"user,omitempty"`
	Comments []ReviewCommentResult `json:"comments,omitempty"`
}

ReviewResult is the result of a CreateReview call.

type ReviewState

type ReviewState string

ReviewState is the normalized state of a code review.

const (
	ReviewStateApproved         ReviewState = "approved"
	ReviewStateChangesRequested ReviewState = "changes_requested"
	ReviewStateCommented        ReviewState = "commented"
	ReviewStatePending          ReviewState = "pending"
)

type SearchIssueResult

type SearchIssueResult struct {
	Number    string     `json:"number"`
	Title     string     `json:"title"`
	Body      string     `json:"body,omitempty"`
	State     IssueState `json:"state"`
	WebURL    string     `json:"web_url,omitempty"`
	Labels    []string   `json:"labels,omitempty"`
	Comments  int        `json:"comments,omitempty"`
	CreatedAt time.Time  `json:"created_at"`
}

SearchIssueResult is a single result from an issue search. Number is the platform's issue addressing identifier as a string, so results feed GetIssue(number string) directly (numeric platforms return "1", Gitee's alphanumeric identifiers return e.g. "IAINVA").

type SearchRepoResult

type SearchRepoResult struct {
	FullName      string `json:"full_name"`
	Description   string `json:"description,omitempty"`
	WebURL        string `json:"web_url,omitempty"`
	Stars         int    `json:"stars,omitempty"`
	Forks         int    `json:"forks,omitempty"`
	DefaultBranch string `json:"default_branch,omitempty"`
	Private       bool   `json:"private,omitempty"`
}

SearchRepoResult is a single result from a repository search.

type SearchUserResult

type SearchUserResult struct {
	Login     string `json:"login"`
	Name      string `json:"name,omitempty"`
	AvatarURL string `json:"avatar_url,omitempty"`
	WebURL    string `json:"web_url,omitempty"`
}

SearchUserResult is a single result from a user search.

type TagInfo

type TagInfo struct {
	Name   string `json:"name"`
	Commit string `json:"commit"`
}

TagInfo represents a tag.

type TestConnectionResult

type TestConnectionResult struct {
	Connected    bool   `json:"connected"`
	Platform     string `json:"platform"`
	UserName     string `json:"user_name"`
	Message      string `json:"message,omitempty"`
	CanListRepos bool   `json:"can_list_repos"`
	CanReadCR    bool   `json:"can_read_cr"`
	CanWriteCR   bool   `json:"can_write_cr"`
	CanWebhook   bool   `json:"can_webhook"`
}

TestConnectionResult contains the result of a connection test.

Directories

Path Synopsis
Package projection trims structured values down to selected fields so automations and LLM/agent flows stop paying tokens for payloads they never read.
Package projection trims structured values down to selected fields so automations and LLM/agent flows stop paying tokens for payloads they never read.

Jump to

Keyboard shortcuts

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