github

package
v0.0.0-...-56ca67e Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2026 License: AGPL-3.0-only Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMostRecentlyUpdatedDiscussion

func GetMostRecentlyUpdatedDiscussion(ctx context.Context, client *github.Client, gqlClient *githubv4.Client, org, repo string) (time.Time, error)

func GetMostRecentlyUpdatedIssue

func GetMostRecentlyUpdatedIssue(ctx context.Context, client *github.Client, gqlClient *githubv4.Client, org, repo string) (time.Time, error)

func GetMostRecentlyUpdatedPullRequest

func GetMostRecentlyUpdatedPullRequest(ctx context.Context, client *github.Client, gqlClient *githubv4.Client, org, repo string) (time.Time, error)

func ListInstallations

func ListInstallations(ctx context.Context, appId int64, appKeyPath string) ([]int64, error)

ListInstallations retrieves all installations for a GitHub App

func NewClient

func NewClient(appId, installationId int64, appKeyPath string) *github.Client

func NewGraphQLClient

func NewGraphQLClient(appId, installationId int64, appKeyPath string) *githubv4.Client

func ParseInstallationIds

func ParseInstallationIds(installationIdsStr string) ([]int64, error)

ParseInstallationIds parses a comma-separated string of installation IDs

func ParseOrDiscoverInstallations

func ParseOrDiscoverInstallations(ctx context.Context, installationIdsStr string, appId int64, appKeyPath string, logger *slog.Logger) ([]int64, error)

ParseOrDiscoverInstallations parses comma-separated installation IDs from a string, or auto-discovers them if the string is empty

func RetrieveDiscussionAndComments

func RetrieveDiscussionAndComments(ctx context.Context, client *github.Client, gqlClient *githubv4.Client, org, repo string, number int64) (db.InsertDiscussionParams, []db.InsertDiscussionCommentParams, error)

func RetrieveIssueAndComments

func RetrieveIssueAndComments(ctx context.Context, client *github.Client, gqlClient *githubv4.Client, org, repo string, number int64) (db.InsertIssueParams, []db.InsertIssueCommentParams, error)

Types

type ClientPair

type ClientPair struct {
	RestClient *github.Client
	GqlClient  *githubv4.Client
	InstallID  int64
}

ClientPair holds a REST and GraphQL client for a specific installation

type ClientPool

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

ClientPool manages multiple GitHub client pairs for rate limit rotation

func NewClientPool

func NewClientPool(appId int64, installationIds []int64, appKeyPath string, logger *slog.Logger) *ClientPool

NewClientPool creates a pool of GitHub clients from installation IDs

func (*ClientPool) GetNextAvailableClient

func (cp *ClientPool) GetNextAvailableClient(ctx context.Context) ClientPair

GetNextAvailableClient returns a client pair with sufficient rate limits It checks both Core and GraphQL rate limits and rotates through clients if needed If all clients are rate limited, it waits until the earliest reset time

type MostRecentlyUpdatedDiscussion

type MostRecentlyUpdatedDiscussion struct {
	Number    int64
	UpdatedAt time.Time
}

func ListMostRecentlyUpdatedDiscussions

func ListMostRecentlyUpdatedDiscussions(ctx context.Context, client *github.Client, gqlClient *githubv4.Client, org, repo string, mostRecent int, cursor *githubv4.String) ([]MostRecentlyUpdatedDiscussion, *githubv4.String, error)

type MostRecentlyUpdatedIssue

type MostRecentlyUpdatedIssue struct {
	Number    int64
	UpdatedAt time.Time
}

func ListMostRecentlyUpdatedIssues

func ListMostRecentlyUpdatedIssues(ctx context.Context, client *github.Client, gqlClient *githubv4.Client, org, repo string, mostRecent int, cursor *githubv4.String) ([]MostRecentlyUpdatedIssue, *githubv4.String, error)

type MostRecentlyUpdatedPullRequest

type MostRecentlyUpdatedPullRequest struct {
	Number    int64
	UpdatedAt time.Time
}

func ListMostRecentlyUpdatedPullRequests

func ListMostRecentlyUpdatedPullRequests(ctx context.Context, client *github.Client, gqlClient *githubv4.Client, org, repo string, mostRecent int, cursor *githubv4.String) ([]MostRecentlyUpdatedPullRequest, *githubv4.String, error)

Jump to

Keyboard shortcuts

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