Documentation
¶
Overview ¶
Package github provides normalisers for GitHub-specific content types.
This package contains normalisers for:
- Issues (application/vnd.github.issue+json)
- Pull Requests (application/vnd.github.pull+json)
These normalisers preserve authorship, labels, state, and comment history in a structured text format suitable for search and retrieval.
Index ¶
Constants ¶
const MIMETypeGitHubIssue = "application/vnd.github.issue+json"
MIMETypeGitHubIssue is the custom MIME type for GitHub issues.
const MIMETypeGitHubPull = "application/vnd.github.pull+json"
MIMETypeGitHubPull is the custom MIME type for GitHub pull requests.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommentContent ¶
type CommentContent struct {
Author string `json:"author"`
Body string `json:"body"`
CreatedAt time.Time `json:"created_at"`
}
CommentContent represents a comment on an issue.
type IssueContent ¶
type IssueContent struct {
Number int `json:"number"`
Title string `json:"title"`
Body string `json:"body"`
State string `json:"state"`
Author string `json:"author"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Labels []string `json:"labels"`
Assignees []string `json:"assignees"`
Milestone string `json:"milestone,omitempty"`
Comments []CommentContent `json:"comments"`
}
IssueContent represents the JSON content of an issue.
type IssueNormaliser ¶
type IssueNormaliser struct{}
IssueNormaliser handles GitHub issue documents.
func (*IssueNormaliser) Normalise ¶
func (n *IssueNormaliser) Normalise(_ context.Context, raw *domain.RawDocument) (*driven.NormaliseResult, error)
Normalise converts a GitHub issue document to a normalised document.
func (*IssueNormaliser) Priority ¶
func (n *IssueNormaliser) Priority() int
Priority returns the selection priority.
func (*IssueNormaliser) SupportedConnectorTypes ¶
func (n *IssueNormaliser) SupportedConnectorTypes() []string
SupportedConnectorTypes returns connector types for specialised handling.
func (*IssueNormaliser) SupportedMIMETypes ¶
func (n *IssueNormaliser) SupportedMIMETypes() []string
SupportedMIMETypes returns the MIME types this normaliser handles.
type PRContent ¶
type PRContent struct {
Number int `json:"number"`
Title string `json:"title"`
Body string `json:"body"`
State string `json:"state"`
Draft bool `json:"draft"`
Merged bool `json:"merged"`
Author string `json:"author"`
HeadBranch string `json:"head_branch"`
BaseBranch string `json:"base_branch"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Labels []string `json:"labels"`
Assignees []string `json:"assignees"`
Reviewers []string `json:"reviewers"`
Additions int `json:"additions"`
Deletions int `json:"deletions"`
ChangedFiles int `json:"changed_files"`
Comments []CommentContent `json:"comments"`
Reviews []ReviewContent `json:"reviews"`
}
PRContent represents the JSON content of a pull request.
type PullNormaliser ¶
type PullNormaliser struct{}
PullNormaliser handles GitHub pull request documents.
func (*PullNormaliser) Normalise ¶
func (n *PullNormaliser) Normalise(_ context.Context, raw *domain.RawDocument) (*driven.NormaliseResult, error)
Normalise converts a GitHub PR document to a normalised document.
func (*PullNormaliser) Priority ¶
func (n *PullNormaliser) Priority() int
Priority returns the selection priority.
func (*PullNormaliser) SupportedConnectorTypes ¶
func (n *PullNormaliser) SupportedConnectorTypes() []string
SupportedConnectorTypes returns connector types for specialised handling.
func (*PullNormaliser) SupportedMIMETypes ¶
func (n *PullNormaliser) SupportedMIMETypes() []string
SupportedMIMETypes returns the MIME types this normaliser handles.