github

package
v0.2.23 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client wraps the GitHub API client with rate limiting and caching

func NewClient

func NewClient(ctx context.Context, cfg *config.Config) (*Client, error)

NewClient creates a new GitHub client with the appropriate authentication

func (*Client) FetchCommits

func (c *Client) FetchCommits(ctx context.Context, owner, repo string, since, until *time.Time) ([]models.Commit, error)

FetchCommits fetches commits from a repository within a date range

func (*Client) FetchIssues

func (c *Client) FetchIssues(ctx context.Context, owner, repo string, since, until *time.Time) ([]models.Issue, error)

FetchIssues fetches issues from a repository Uses early termination when sorted by date - stops when items are outside date range

func (*Client) FetchPullRequests

func (c *Client) FetchPullRequests(ctx context.Context, owner, repo string, since, until *time.Time) ([]models.PullRequest, error)

FetchPullRequests fetches pull requests from a repository Fetches PRs targeting main branches, filters by merge date

func (*Client) FetchReviews

func (c *Client) FetchReviews(ctx context.Context, owner, repo string, prNumber int) ([]models.Review, error)

FetchReviews fetches reviews for a specific pull request

func (*Client) FetchUserProfiles

func (c *Client) FetchUserProfiles(ctx context.Context, logins []string) (map[string]UserProfile, error)

FetchUserProfiles fetches GitHub profiles for a list of logins This is useful for deduplication by getting user IDs, names, and public emails

func (*Client) ListOrgRepos

func (c *Client) ListOrgRepos(ctx context.Context, org, pattern string) ([]string, error)

ListOrgRepos lists repositories in an organization matching a pattern

func (*Client) SetProgressCallback

func (c *Client) SetProgressCallback(cb ProgressCallback)

SetProgressCallback sets the callback function for progress reporting

func (*Client) SetRetryConfig

func (c *Client) SetRetryConfig(rc RetryConfig)

SetRetryConfig sets the retry configuration

type ProgressCallback

type ProgressCallback func(message string)

ProgressCallback is called to report progress during API operations

type RetryConfig

type RetryConfig struct {
	MaxRetries     int
	InitialBackoff time.Duration
	MaxBackoff     time.Duration
}

RetryConfig holds retry settings

func DefaultRetryConfig

func DefaultRetryConfig() RetryConfig

DefaultRetryConfig returns the default retry configuration

type UserProfile

type UserProfile struct {
	ID        int64  // GitHub user ID
	Login     string // GitHub username
	Name      string // Display name
	Email     string // Public email (may be empty)
	AvatarURL string
}

UserProfile contains GitHub user profile information useful for deduplication

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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