github

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 5, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package github wraps the `gh` CLI to fetch pull request diffs and file contents.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CollectTODOs

func CollectTODOs(fetcher PRFetcher, repo, pr string, todoTypes []string) ([]types.TODO, error)

CollectTODOs fetches and parses TODOs from a PR diff using the given fetcher and the specified TODO marker types.

Types

type Client

type Client struct{}

func NewClient

func NewClient() *Client

func (*Client) FetchChangedFileContents

func (c *Client) FetchChangedFileContents(repo, pr, diffOutput string) (map[string][]byte, error)

func (*Client) FetchDiff

func (c *Client) FetchDiff(repo, pr string) (string, error)

func (*Client) FetchFileAtRef added in v1.1.0

func (c *Client) FetchFileAtRef(repo, path, ref string) ([]byte, bool, error)

FetchFileAtRef fetches a file from the repository at a specific ref. Returns (nil, false, nil) when the file is not found (404).

func (*Client) FetchRemoteConfigRefs added in v1.1.0

func (c *Client) FetchRemoteConfigRefs(repo, pr string) (config.RemoteConfigRefs, error)

FetchRemoteConfigRefs returns repository and PR refs for remote config loading.

type PRFetcher

type PRFetcher interface {
	FetchDiff(repo, pr string) (string, error)
	FetchChangedFileContents(repo, pr, diffOutput string) (map[string][]byte, error)
}

Jump to

Keyboard shortcuts

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