Help us shape the future of Go! Take the 2026 Go Developer Survey

github

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

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

View Source
const MIMETypeGitHubIssue = "application/vnd.github.issue+json"

MIMETypeGitHubIssue is the custom MIME type for GitHub issues.

View Source
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 NewIssue

func NewIssue() *IssueNormaliser

NewIssue creates a new GitHub issue normaliser.

func (*IssueNormaliser) Normalise

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 NewPull

func NewPull() *PullNormaliser

NewPull creates a new GitHub pull request normaliser.

func (*PullNormaliser) Normalise

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.

type ReviewContent

type ReviewContent struct {
	Author      string    `json:"author"`
	State       string    `json:"state"`
	Body        string    `json:"body"`
	SubmittedAt time.Time `json:"submitted_at"`
}

ReviewContent represents a review on a pull request.

Jump to

Keyboard shortcuts

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