Documentation
¶
Overview ¶
Package search provides GitHub search API functionality.
Index ¶
- Constants
- Variables
- type Client
- func (c *Client) SearchIssues(ctx context.Context, qry Query, opts *github.SearchOptions) (*github.IssuesSearchResult, *github.Response, error)
- func (c *Client) SearchIssuesAll(ctx context.Context, qry Query, opts *github.SearchOptions) (Issues, error)
- func (c *Client) SearchOpenPullRequests(ctx context.Context, username string, opts *github.SearchOptions) (*github.IssuesSearchResult, *github.Response, error)
- type Issue
- type Issues
- type Query
Constants ¶
const ( BaseURLRepoAPI = "https://api.github.com/repos" BaseURLRepoHTML = "https://github.com" )
Base URLs for converting between API and HTML URLs.
const ( UsernameDependabot = "dependabot[bot]" UserIDDependabot = 49699333 )
Known bot users.
const ( ParamUser = "user" ParamState = "state" ParamIs = "is" ParamOrg = "org" ParamRepo = "repo" ParamType = "type" )
Query parameter names.
const ( ParamStateValueOpen = "open" ParamStateValueClosed = "closed" ParamIsValuePR = "pr" ParamIsValueIssue = "issue" )
Query parameter values.
const ( ParamPerPageValueMax = 100 ParamPerPageValueDefault = 30 )
Pagination constants.
Variables ¶
var ( ErrIssueIsNotSet = errors.New("issue is not set") ErrUserIsNotSet = errors.New("user is not set") ErrUserLoginIsNotSet = errors.New("user login is not set") ErrIssueCreatedAtIsNotSet = errors.New("issue created at is not set") ErrIssueCreatedAtGetTimeIsNotSet = errors.New("issue created at gettime is not set") )
Issue-related errors.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps the GitHub client for search operations.
func NewClientHTTP ¶
NewClientHTTP creates a new search client from an HTTP client.
func (*Client) SearchIssues ¶
func (c *Client) SearchIssues(ctx context.Context, qry Query, opts *github.SearchOptions) (*github.IssuesSearchResult, *github.Response, error)
SearchIssues is a wrapper for SearchService.Issues().
func (*Client) SearchIssuesAll ¶
func (c *Client) SearchIssuesAll(ctx context.Context, qry Query, opts *github.SearchOptions) (Issues, error)
SearchIssuesAll retrieves all issues matching the query with pagination.
func (*Client) SearchOpenPullRequests ¶
func (c *Client) SearchOpenPullRequests(ctx context.Context, username string, opts *github.SearchOptions) (*github.IssuesSearchResult, *github.Response, error)
SearchOpenPullRequests searches for open pull requests by username.
type Issue ¶
Issue wraps a GitHub issue with helper methods.
func (*Issue) AuthorUserID ¶
AuthorUserID returns the author's user ID.
func (*Issue) AuthorUsername ¶
AuthorUsername returns the author's username.
func (*Issue) CreatedAge ¶
CreatedAge returns the duration since the issue was created.
func (*Issue) CreatedTime ¶
CreatedTime returns the issue creation time.
func (*Issue) MustAuthorUserID ¶
MustAuthorUserID returns the author user ID or -1 on error.
func (*Issue) MustAuthorUsername ¶
MustAuthorUsername returns the author username or empty string on error.
type Issues ¶
Issues is a slice of GitHub issues.
func (Issues) RepositoryIssueCounts ¶
RepositoryIssueCounts returns a map of repository URLs to issue counts.
func (Issues) TableRepos ¶
TableRepos creates a table of repositories with issue counts.