Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BranchType ¶
type BranchType int
const ( BranchTypeUnknown BranchType = iota BranchTypeDev BranchTypePr )
func (BranchType) String ¶ added in v1.74.0
func (bt BranchType) String() string
type Notes ¶
type Notes struct {
// Version indicates the version of the Notes structure.
Version string `json:"version"`
// Deprecated: use IssueURL. Kept for backward compatibility with old notes.
GithubIssueURL string `json:"github_issue_url,omitempty"`
// Deprecated: use IssueURL. Kept for backward compatibility with old notes.
JiraTicketURL string `json:"jira_ticket_url,omitempty"`
BranchType BranchType `json:"branch_type"` // Optional field to specify the type of branch (`dev` or `pr`)
// Description is the original text from the dev branch creation (e.g., from `qs dev {some text}`)
Description string `json:"description,omitempty"`
// IssueURL is the URL of the issue associated with the branch (GitHub, Jira, or any other tracker).
IssueURL string `json:"issue_url,omitempty"`
}
Notes represents the structure for storing metadata related to branch.
func Deserialize ¶
Deserialize fetches JSON string object and tries to unmarshal it into Notes structure. Parameters: - notes: a slice of strings Returns: - a pointer to Notes structure if successful - error if JSON parsing fails or the stored version is not in supportedVersions
func ReadNotes ¶ added in v1.84.0
ReadNotes reads notes from rawNotes, supporting all formats:
- JSON format (version 1.0) — pure JSON blob
- Old plain-text format — "Resolves issue" / "Resolves #" markers or plain title + URL
Returns a *Notes struct populated from whichever format is detected. For old plain-text format, BranchType is set to BranchTypeDev.
Click to show internal directories.
Click to hide internal directories.