Documentation
¶
Index ¶
- func GetMostRecentlyUpdatedDiscussion(ctx context.Context, client *github.Client, gqlClient *githubv4.Client, ...) (time.Time, error)
- func GetMostRecentlyUpdatedIssue(ctx context.Context, client *github.Client, gqlClient *githubv4.Client, ...) (time.Time, error)
- func GetMostRecentlyUpdatedPullRequest(ctx context.Context, client *github.Client, gqlClient *githubv4.Client, ...) (time.Time, error)
- func ListInstallations(ctx context.Context, appId int64, appKeyPath string) ([]int64, error)
- func NewClient(appId, installationId int64, appKeyPath string) *github.Client
- func NewGraphQLClient(appId, installationId int64, appKeyPath string) *githubv4.Client
- func ParseInstallationIds(installationIdsStr string) ([]int64, error)
- func ParseOrDiscoverInstallations(ctx context.Context, installationIdsStr string, appId int64, appKeyPath string, ...) ([]int64, error)
- func RetrieveDiscussionAndComments(ctx context.Context, client *github.Client, gqlClient *githubv4.Client, ...) (db.InsertDiscussionParams, []db.InsertDiscussionCommentParams, error)
- func RetrieveIssueAndComments(ctx context.Context, client *github.Client, gqlClient *githubv4.Client, ...) (db.InsertIssueParams, []db.InsertIssueCommentParams, error)
- func RetrievePullRequestAndComments(ctx context.Context, client *github.Client, gqlClient *githubv4.Client, ...) (db.InsertPullRequestParams, []db.InsertPullRequestCommentParams, ...)
- type ClientPair
- type ClientPool
- type MostRecentlyUpdatedDiscussion
- type MostRecentlyUpdatedIssue
- type MostRecentlyUpdatedPullRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ListInstallations ¶
ListInstallations retrieves all installations for a GitHub App
func NewGraphQLClient ¶
func ParseInstallationIds ¶
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 RetrievePullRequestAndComments ¶
func RetrievePullRequestAndComments(ctx context.Context, client *github.Client, gqlClient *githubv4.Client, org, repo string, number int64) (db.InsertPullRequestParams, []db.InsertPullRequestCommentParams, []db.InsertPullRequestReviewParams, []db.InsertPullRequestReviewCommentParams, error)
Types ¶
type ClientPair ¶
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