github

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCurrentUser

func GetCurrentUser() (string, error)

GetCurrentUser returns the authenticated GitHub username

func GetQuery

func GetQuery(qt QueryType) string

GetQuery returns the GraphQL query string for the given query type

Types

type LabelNode

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

LabelNode represents a label on a PR/Issue

type LinkedIssueNode

type LinkedIssueNode struct {
	Number int    `json:"number"`
	Title  string `json:"title"`
	URL    string `json:"url"`
}

LinkedIssueNode represents an issue linked via closingIssuesReferences

type QueryType

type QueryType int

QueryType indicates which GraphQL query variant to use

const (
	// QueryBasic fetches PR/Issue with labels and reviewer logins (for collect command)
	QueryBasic QueryType = iota
	// QueryWithLinkedIssues fetches PR with closingIssuesReferences and mergedAt (for daily authored PRs)
	QueryWithLinkedIssues
	// QueryWithReviews fetches PR with review details including state and submittedAt (for daily reviews)
	QueryWithReviews
)

type ReviewNode

type ReviewNode struct {
	State       string    `json:"state"`
	SubmittedAt time.Time `json:"submittedAt"`
	URL         string    `json:"url"`
	Author      struct {
		Login string `json:"login"`
	} `json:"author"`
}

ReviewNode represents a review on a PR

type SearchNode

type SearchNode struct {
	Typename   string `json:"__typename"`
	URL        string `json:"url"`
	Repository struct {
		NameWithOwner string `json:"nameWithOwner"`
	} `json:"repository"`
	Number    int       `json:"number"`
	Title     string    `json:"title"`
	Body      string    `json:"body"`
	State     string    `json:"state"`
	CreatedAt time.Time `json:"createdAt"`
	UpdatedAt time.Time `json:"updatedAt"`
	ClosedAt  time.Time `json:"closedAt"`
	MergedAt  time.Time `json:"mergedAt"`
	Author    struct {
		Login string `json:"login"`
	} `json:"author"`
	Labels struct {
		Nodes []LabelNode `json:"nodes"`
	} `json:"labels"`
	Reviews struct {
		Nodes []ReviewNode `json:"nodes"`
	} `json:"reviews"`
	ClosingIssuesReferences struct {
		Nodes []LinkedIssueNode `json:"nodes"`
	} `json:"closingIssuesReferences"`
}

SearchNode represents a unified node from GitHub GraphQL search covering all fields needed by collect and daily commands

func RunSearch

func RunSearch(query string, queryType QueryType) ([]SearchNode, error)

RunSearch executes a paginated GitHub GraphQL search and returns all matching nodes

Jump to

Keyboard shortcuts

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