{"modulePath":"github.com/codeGROOVE-dev/slacker","version":"v0.0.0-20260117180538-72f1ef61c586","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package github\n\nPackage github provides a GitHub API client for GitHub App interactions.\n\n## Types\n\n```go\ntype Client struct {\n\t// contains filtered or unexported fields\n}\n```\nClient wraps the GitHub API client.\n\n```go\nfunc New(ctx context.Context, appID, privateKeyPEM, installationID string) (*Client, error)\n```\nNew creates a new GitHub client configured as a GitHub App.\n\n```go\nfunc (c *Client) Client() any\n```\nClient returns the underlying GitHub client.\n\n```go\nfunc (c *Client) FindPRsForCommit(ctx context.Context, owner, repo, sha string) ([]int, error)\n```\nFindPRsForCommit finds all open PRs associated with a commit SHA.\n\n```go\nfunc (c *Client) InstallationToken(ctx context.Context) string\n```\nInstallationToken returns the current installation token, refreshing if needed. This method is safe to call concurrently - only one goroutine will perform the refresh.\n\n```go\nfunc (c *Client) Organization() string\n```\nOrganization returns the organization associated with this installation.\n\n```go\nfunc (c *Client) RefreshToken(ctx context.Context) error\n```\nRefreshToken forces a token refresh.\n\n```go\ntype ClientInterface interface {\n\t// Client returns the underlying go-github client for advanced operations.\n\tClient() any\n\n\t// InstallationToken returns the current installation token for authentication.\n\tInstallationToken(ctx context.Context) string\n}\n```\nClientInterface defines the interface for GitHub API operations. This interface enables testing of code that depends on Client.\n\n```go\ntype GraphQLClient = SearchClient\n```\nGraphQLClient is a deprecated alias for SearchClient for backwards compatibility. Use SearchClient instead.\n\n```go\nfunc NewGraphQLClient(ctx context.Context, token string) *GraphQLClient\n```\nNewGraphQLClient creates a new search client (deprecated name). Use NewSearchClient instead.\n\n```go\ntype Manager struct {\n\t// contains filtered or unexported fields\n}\n```\nManager manages multiple GitHub App installations.\n\n```go\nfunc NewManager(ctx context.Context, appID, privateKeyPEM string, allowPersonalAccounts bool) (*Manager, error)\n```\nNewManager creates a new installation manager.\n\n```go\nfunc (m *Manager) AllOrgs() []string\n```\nAllOrgs returns a list of all organizations with active installations.\n\n```go\nfunc (m *Manager) ClientForOrg(org string) (*Client, bool)\n```\nClientForOrg returns the GitHub client for a specific organization.\n\n```go\nfunc (m *Manager) RefreshInstallations(ctx context.Context) error\n```\nRefreshInstallations discovers all installations and creates clients for them.\n\n```go\ntype ManagerInterface interface {\n\t// AllOrgs returns all configured organizations.\n\tAllOrgs() []string\n\n\t// ClientForOrg returns the GitHub client for a specific organization.\n\tClientForOrg(org string) (ClientInterface, bool)\n}\n```\nManagerInterface defines the interface for GitHub installation management. This interface enables testing of code that depends on Manager.\n\n```go\nfunc WrapManager(m *Manager) ManagerInterface\n```\nWrapManager wraps a Manager to implement ManagerInterface. This is needed because Manager.ClientForOrg returns \\*Client, but ManagerInterface.ClientForOrg must return ClientInterface.\n\n```go\ntype PRInfo struct {\n\tCreatedAt time.Time\n\tUpdatedAt time.Time\n\tOwner     string\n\tRepo      string\n\tTitle     string\n\tAuthor    string\n\tState     string\n\tURL       string\n\tBlockedOn []string\n\tNumber    int\n}\n```\nPRInfo contains simplified PR information.\n\n```go\ntype PRSnapshot struct {\n\tUpdatedAt time.Time\n\tCreatedAt time.Time\n\tOwner     string\n\tRepo      string\n\tTitle     string\n\tAuthor    string\n\tURL       string\n\tState     string // \"OPEN\", \"CLOSED\", \"MERGED\"\n\tNumber    int\n\tIsDraft   bool\n}\n```\nPRSnapshot contains minimal PR information from search query.\n\n```go\ntype SearchClient struct {\n\t// contains filtered or unexported fields\n}\n```\nSearchClient wraps the GitHub Search API client for querying PRs.\n\n```go\nfunc NewSearchClient(ctx context.Context, token string) *SearchClient\n```\nNewSearchClient creates a new search client with the given token.\n\n```go\nfunc (c *SearchClient) ListClosedPRs(ctx context.Context, org string, updatedSinceHours int) ([]PRSnapshot, error)\n```\nListClosedPRs queries all closed/merged PRs for an organization updated in the last N hours. This is used to update Slack threads when PRs are closed or merged.\n\n```go\nfunc (c *SearchClient) ListOpenPRs(ctx context.Context, org string, updatedSinceHours int) ([]PRSnapshot, error)\n```\nListOpenPRs queries all open PRs for an organization updated in the last N hours. Uses GitHub Search API which is simpler and more reliable than GraphQL.\n\n```go\ntype TurnClient interface {\n\tCheck(ctx context.Context, prURL, username string, eventTime time.Time) (*turn.CheckResponse, error)\n}\n```\nTurnClient is an interface for PR analysis.\n\n```go\nfunc NewTurnClient(token string) (TurnClient, error)\n```\nNewTurnClient creates a turnclient with the given token.\n\n","path":"github.com/codeGROOVE-dev/slacker/pkg/github","name":"github","synopsis":"Package github provides a GitHub API client for GitHub App interactions.","isRedistributable":true}
