{"modulePath":"github.com/gollem-dev/tools/github","version":"v0.3.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package github\n\nPackage github provides a gollem.ToolSet for GitHub code/issue search, file content retrieval, commit history listing, and git blame.\n\nPackage github provides a gollem.ToolSet for GitHub code/issue search, file content retrieval, commit history listing, and git blame.\n\n## Types\n\n```go\ntype BlameRange struct {\n\tStartLine     int       `json:\"start_line\"`\n\tEndLine       int       `json:\"end_line\"`\n\tCommitSHA     string    `json:\"commit_sha\"`\n\tCommitMessage string    `json:\"commit_message\"`\n\tAuthor        string    `json:\"author\"`\n\tDate          time.Time `json:\"date\"`\n}\n```\nBlameRange represents a contiguous set of lines attributed to a single commit.\n\n```go\ntype CodeSearchResult struct {\n\tRepository string   `json:\"repository\"`\n\tPath       string   `json:\"path\"`\n\tHTMLURL    string   `json:\"html_url\"`\n\tMatches    []string `json:\"matches\"`\n}\n```\nCodeSearchResult represents a single code search result.\n\n```go\ntype CommitResult struct {\n\tSHA     string    `json:\"sha\"`\n\tMessage string    `json:\"message\"`\n\tAuthor  string    `json:\"author\"`\n\tDate    time.Time `json:\"date\"`\n\tHTMLURL string    `json:\"html_url\"`\n}\n```\nCommitResult represents a single commit in the list-commits response.\n\n```go\ntype ContentResult struct {\n\tRepository string `json:\"repository\"`\n\tPath       string `json:\"path\"`\n\tContent    string `json:\"content\"`\n\tSHA        string `json:\"sha\"`\n\tHTMLURL    string `json:\"html_url\"`\n\tSize       int    `json:\"size\"`\n}\n```\nContentResult represents file content retrieved from a repository.\n\n```go\ntype IssueComment struct {\n\tAuthor    string    `json:\"author\"`\n\tBody      string    `json:\"body\"`\n\tCreatedAt time.Time `json:\"created_at\"`\n\tURL       string    `json:\"url\"`\n}\n```\nIssueComment represents a single comment on an issue or pull request.\n\n```go\ntype IssueDetailResult struct {\n\tNumber    int            `json:\"number\"`\n\tTitle     string         `json:\"title\"`\n\tBody      string         `json:\"body\"`\n\tAuthor    string         `json:\"author\"`\n\tState     string         `json:\"state\"`\n\tURL       string         `json:\"url\"`\n\tLabels    []string       `json:\"labels\"`\n\tCreatedAt time.Time      `json:\"created_at\"`\n\tUpdatedAt time.Time      `json:\"updated_at\"`\n\tClosedAt  *time.Time     `json:\"closed_at,omitempty\"`\n\tComments  []IssueComment `json:\"comments\"`\n}\n```\nIssueDetailResult represents a single issue fetched with full body and comments.\n\n```go\ntype IssueSearchResult struct {\n\tRepository string    `json:\"repository\"`\n\tNumber     int       `json:\"number\"`\n\tTitle      string    `json:\"title\"`\n\tState      string    `json:\"state\"`\n\tHTMLURL    string    `json:\"html_url\"`\n\tUser       string    `json:\"user\"`\n\tCreatedAt  time.Time `json:\"created_at\"`\n\tUpdatedAt  time.Time `json:\"updated_at\"`\n\tIsPR       bool      `json:\"is_pr\"`\n\tBody       string    `json:\"body,omitempty\"`\n\tLabels     []string  `json:\"labels,omitempty\"`\n}\n```\nIssueSearchResult represents a single issue or pull-request search result.\n\n```go\ntype Option func(*ToolSet)\n```\nOption configures a ToolSet.\n\n```go\nfunc WithLogger(logger *slog.Logger) Option\n```\nWithLogger sets the logger. A nil logger keeps the default (slog.Default()).\n\n```go\ntype PullRequestDetailResult struct {\n\tNumber    int                 `json:\"number\"`\n\tTitle     string              `json:\"title\"`\n\tBody      string              `json:\"body\"`\n\tAuthor    string              `json:\"author\"`\n\tState     string              `json:\"state\"`\n\tURL       string              `json:\"url\"`\n\tLabels    []string            `json:\"labels\"`\n\tMerged    bool                `json:\"merged\"`\n\tDraft     bool                `json:\"draft\"`\n\tBaseRef   string              `json:\"base_ref\"`\n\tHeadRef   string              `json:\"head_ref\"`\n\tCreatedAt time.Time           `json:\"created_at\"`\n\tUpdatedAt time.Time           `json:\"updated_at\"`\n\tClosedAt  *time.Time          `json:\"closed_at,omitempty\"`\n\tComments  []IssueComment      `json:\"comments\"`\n\tReviews   []PullRequestReview `json:\"reviews\"`\n\tFiles     []PullRequestFile   `json:\"files,omitempty\"`\n}\n```\nPullRequestDetailResult represents a single pull request fetched with body, comments, reviews, and optionally the file diff.\n\n```go\ntype PullRequestFile struct {\n\tPath           string `json:\"path\"`\n\tStatus         string `json:\"status\"`\n\tAdditions      int    `json:\"additions\"`\n\tDeletions      int    `json:\"deletions\"`\n\tPatch          string `json:\"patch\"`\n\tPatchTruncated bool   `json:\"patch_truncated\"`\n}\n```\nPullRequestFile represents a single changed file in a pull request.\n\n```go\ntype PullRequestReview struct {\n\tAuthor    string    `json:\"author\"`\n\tBody      string    `json:\"body\"`\n\tState     string    `json:\"state\"`\n\tCreatedAt time.Time `json:\"created_at\"`\n}\n```\nPullRequestReview represents a single review on a pull request.\n\n```go\ntype ToolSet struct {\n\t// contains filtered or unexported fields\n}\n```\nToolSet implements gollem.ToolSet for GitHub. Fields are unexported; configure via Option.\n\n```go\nfunc New(appID int64, installationID int64, privateKey string, opts ...Option) (*ToolSet, error)\n```\nNew constructs the ToolSet with the three required credentials as positional arguments. appID and installationID must be non-zero; privateKey must be a non-empty PEM string. Optional settings (e.g. WithLogger) are passed as opts. New performs only in-memory validation and transport construction; use Ping to verify connectivity.\n\n```go\nfunc (t *ToolSet) Ping(ctx context.Context) error\n```\nPing verifies connectivity and credentials by fetching a short-lived installation token from the GitHub API.\n\n```go\nfunc (t *ToolSet) Run(ctx context.Context, name string, args map[string]any) (map[string]any, error)\n```\nRun dispatches to the matching typed tool by name.\n\n```go\nfunc (t *ToolSet) Specs(_ context.Context) ([]gollem.ToolSpec, error)\n```\nSpecs returns the tool specifications derived from the typed tool definitions.\n\n","path":"github.com/gollem-dev/tools/github","name":"github","synopsis":"Package github provides a gollem.ToolSet for GitHub code/issue search, file content retrieval, commit history listing, and git blame.","isRedistributable":true}
