Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrValidationFailed = fmt.Errorf("validation failed")
ErrValidationFailed is returned when GitHub returns a 422 Validation Failed response.
Functions ¶
func UpdateContent ¶
func UpdateContent(parsed *ParsedURL, item ContentItem, newBody string) error
UpdateContent updates a single content item on GitHub.
func UpdateTitle ¶ added in v0.4.0
func UpdateTitle(parsed *ParsedURL, item ContentItem, newTitle string) error
UpdateTitle updates the title of a PR, Issue, or Discussion on GitHub.
Types ¶
type ContentItem ¶
type ContentItem struct {
Type ContentType
NodeID string // GraphQL node ID (used for Discussion operations)
DatabaseID int64 // REST numeric ID (used for Issue/Review comment operations)
Number int // PR/Issue number (used for body updates)
Title string // PR/Issue/Discussion title (empty for comments)
Body string
IsBot bool // true if the author is a bot
}
ContentItem represents a single piece of content to translate. The ID field used for updates depends on ContentType:
- PR/Issue body → Number
- Issue comment / Review comment → DatabaseID
- Discussion body / comment / reply → NodeID
func FetchContent ¶
func FetchContent(parsed *ParsedURL, bodyOnly bool) ([]ContentItem, error)
FetchContent fetches all content items for the given parsed URL.
type ContentType ¶
type ContentType string
ContentType represents the type of GitHub content to translate.
const ( ContentTypePRBody ContentType = "pr_body" ContentTypeIssueBody ContentType = "issue_body" ContentTypeDiscussionBody ContentType = "discussion_body" ContentTypeIssueComment ContentType = "issue_comment" ContentTypeReviewComment ContentType = "review_comment" ContentTypeDiscussionComment ContentType = "discussion_comment" )
Click to show internal directories.
Click to hide internal directories.