Documentation ¶
Index ¶
- type Client
- func (c Client) Code(ctx context.Context, req *CodeReq, opt ...requests.Option) (*CodeResponse, error)
- func (c Client) Commits(ctx context.Context, req *CommitsReq, opt ...requests.Option) (*CommitsResponse, error)
- func (c Client) IssuesAndPullRequests(ctx context.Context, req *IssuesAndPullRequestsReq, opt ...requests.Option) (*IssuesAndPullRequestsResponse, error)
- func (c Client) Labels(ctx context.Context, req *LabelsReq, opt ...requests.Option) (*LabelsResponse, error)
- func (c Client) Repos(ctx context.Context, req *ReposReq, opt ...requests.Option) (*ReposResponse, error)
- func (c Client) Topics(ctx context.Context, req *TopicsReq, opt ...requests.Option) (*TopicsResponse, error)
- func (c Client) Users(ctx context.Context, req *UsersReq, opt ...requests.Option) (*UsersResponse, error)
- type CodeReq
- type CodeResponse
- type CodeResponseBody
- type CommitsReq
- type CommitsResponse
- type CommitsResponseBody
- type IssuesAndPullRequestsReq
- type IssuesAndPullRequestsResponse
- type IssuesAndPullRequestsResponseBody
- type LabelsReq
- type LabelsResponse
- type LabelsResponseBody
- type ReposReq
- type ReposResponse
- type ReposResponseBody
- type TopicsReq
- type TopicsResponse
- type TopicsResponseBody
- type UsersReq
- type UsersResponse
- type UsersResponseBody
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client is a set of options to apply to requests
func (Client) Code ¶
func (c Client) Code(ctx context.Context, req *CodeReq, opt ...requests.Option) (*CodeResponse, error)
Code performs requests for "search/code"
Search code.
GET /search/code
https://developer.github.com/v3/search/#search-code
Non-nil errors will have the type *requests.RequestError, octo.ResponseError or url.Error.
func (Client) Commits ¶
func (c Client) Commits(ctx context.Context, req *CommitsReq, opt ...requests.Option) (*CommitsResponse, error)
Commits performs requests for "search/commits"
Search commits.
GET /search/commits
https://developer.github.com/v3/search/#search-commits
Non-nil errors will have the type *requests.RequestError, octo.ResponseError or url.Error.
func (Client) IssuesAndPullRequests ¶
func (c Client) IssuesAndPullRequests(ctx context.Context, req *IssuesAndPullRequestsReq, opt ...requests.Option) (*IssuesAndPullRequestsResponse, error)
IssuesAndPullRequests performs requests for "search/issues-and-pull-requests"
Search issues and pull requests.
GET /search/issues
https://developer.github.com/v3/search/#search-issues-and-pull-requests
Non-nil errors will have the type *requests.RequestError, octo.ResponseError or url.Error.
func (Client) Labels ¶
func (c Client) Labels(ctx context.Context, req *LabelsReq, opt ...requests.Option) (*LabelsResponse, error)
Labels performs requests for "search/labels"
Search labels.
GET /search/labels
https://developer.github.com/v3/search/#search-labels
Non-nil errors will have the type *requests.RequestError, octo.ResponseError or url.Error.
func (Client) Repos ¶
func (c Client) Repos(ctx context.Context, req *ReposReq, opt ...requests.Option) (*ReposResponse, error)
Repos performs requests for "search/repos"
Search repositories.
GET /search/repositories
https://developer.github.com/v3/search/#search-repositories
Non-nil errors will have the type *requests.RequestError, octo.ResponseError or url.Error.
func (Client) Topics ¶
func (c Client) Topics(ctx context.Context, req *TopicsReq, opt ...requests.Option) (*TopicsResponse, error)
Topics performs requests for "search/topics"
Search topics.
GET /search/topics
https://developer.github.com/v3/search/#search-topics
Non-nil errors will have the type *requests.RequestError, octo.ResponseError or url.Error.
func (Client) Users ¶
func (c Client) Users(ctx context.Context, req *UsersReq, opt ...requests.Option) (*UsersResponse, error)
Users performs requests for "search/users"
Search users.
GET /search/users
https://developer.github.com/v3/search/#search-users
Non-nil errors will have the type *requests.RequestError, octo.ResponseError or url.Error.
type CodeReq ¶
type CodeReq struct { /* The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://developer.github.com/v3/search/#constructing-a-search-query). See "[Searching code](https://help.github.com/articles/searching-code/)" for a detailed list of qualifiers. */ Q *string /* Sorts the results of your query. Can only be `indexed`, which indicates how recently a file has been indexed by the GitHub search infrastructure. Default: [best match](https://developer.github.com/v3/search/#ranking-search-results) */ Sort *string /* Determines whether the first search result returned is the highest number of matches (`desc`) or lowest number of matches (`asc`). This parameter is ignored unless you provide `sort`. */ Order *string // Results per page (max 100) PerPage *int64 // Page number of the results to fetch. Page *int64 // contains filtered or unexported fields }
CodeReq is request data for Client.Code
https://developer.github.com/v3/search/#search-code
Non-nil errors will have the type *requests.RequestError, octo.ResponseError or url.Error.
func (*CodeReq) HTTPRequest ¶
HTTPRequest builds an *http.Request. Non-nil errors will have the type *requests.RequestError.
type CodeResponse ¶
type CodeResponse struct { Data CodeResponseBody // contains filtered or unexported fields }
CodeResponse is a response for Code
https://developer.github.com/v3/search/#search-code
func (*CodeResponse) HTTPResponse ¶
func (r *CodeResponse) HTTPResponse() *http.Response
HTTPResponse returns the *http.Response
func (*CodeResponse) ReadResponse ¶
func (r *CodeResponse) ReadResponse(resp *http.Response) error
ReadResponse reads an *http.Response. Non-nil errors will have the type octo.ResponseError.
type CodeResponseBody ¶
type CodeResponseBody struct { IncompleteResults bool `json:"incomplete_results,omitempty"` Items []components.CodeSearchResultItem `json:"items,omitempty"` TotalCount int64 `json:"total_count,omitempty"` }
CodeResponseBody is a response body for Code
type CommitsReq ¶
type CommitsReq struct { /* The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://developer.github.com/v3/search/#constructing-a-search-query). See "[Searching commits](https://help.github.com/articles/searching-commits/)" for a detailed list of qualifiers. */ Q *string /* Sorts the results of your query by `author-date` or `committer-date`. Default: [best match](https://developer.github.com/v3/search/#ranking-search-results) */ Sort *string /* Determines whether the first search result returned is the highest number of matches (`desc`) or lowest number of matches (`asc`). This parameter is ignored unless you provide `sort`. */ Order *string // Results per page (max 100) PerPage *int64 // Page number of the results to fetch. Page *int64 /* The Commit Search API is currently available for developers to preview. During the preview period, the APIs may change without advance notice. Please see the [blog post](https://developer.github.com/changes/2017-01-05-commit-search-api/) for full details. To access the API you must set this to true. */ CloakPreview bool // contains filtered or unexported fields }
CommitsReq is request data for Client.Commits
https://developer.github.com/v3/search/#search-commits
Non-nil errors will have the type *requests.RequestError, octo.ResponseError or url.Error.
func (*CommitsReq) HTTPRequest ¶
func (r *CommitsReq) HTTPRequest(ctx context.Context, opt ...requests.Option) (*http.Request, error)
HTTPRequest builds an *http.Request. Non-nil errors will have the type *requests.RequestError.
func (*CommitsReq) Rel ¶
func (r *CommitsReq) Rel(link string, resp *CommitsResponse) bool
Rel updates this request to point to a relative link from resp. Returns false if the link does not exist. Handy for paging.
type CommitsResponse ¶
type CommitsResponse struct { Data CommitsResponseBody // contains filtered or unexported fields }
CommitsResponse is a response for Commits
https://developer.github.com/v3/search/#search-commits
func Commits ¶
func Commits(ctx context.Context, req *CommitsReq, opt ...requests.Option) (*CommitsResponse, error)
Commits performs requests for "search/commits"
Search commits.
GET /search/commits
func (*CommitsResponse) HTTPResponse ¶
func (r *CommitsResponse) HTTPResponse() *http.Response
HTTPResponse returns the *http.Response
func (*CommitsResponse) ReadResponse ¶
func (r *CommitsResponse) ReadResponse(resp *http.Response) error
ReadResponse reads an *http.Response. Non-nil errors will have the type octo.ResponseError.
type CommitsResponseBody ¶
type CommitsResponseBody struct { IncompleteResults bool `json:"incomplete_results,omitempty"` Items []components.CommitSearchResultItem `json:"items,omitempty"` TotalCount int64 `json:"total_count,omitempty"` }
CommitsResponseBody is a response body for Commits
type IssuesAndPullRequestsReq ¶
type IssuesAndPullRequestsReq struct { /* The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://developer.github.com/v3/search/#constructing-a-search-query). See "[Searching issues and pull requests](https://help.github.com/articles/searching-issues-and-pull-requests/)" for a detailed list of qualifiers. */ Q *string /* Sorts the results of your query by the number of `comments`, `reactions`, `reactions-+1`, `reactions--1`, `reactions-smile`, `reactions-thinking_face`, `reactions-heart`, `reactions-tada`, or `interactions`. You can also sort results by how recently the items were `created` or `updated`, Default: [best match](https://developer.github.com/v3/search/#ranking-search-results) */ Sort *string /* Determines whether the first search result returned is the highest number of matches (`desc`) or lowest number of matches (`asc`). This parameter is ignored unless you provide `sort`. */ Order *string // Results per page (max 100) PerPage *int64 // Page number of the results to fetch. Page *int64 // contains filtered or unexported fields }
IssuesAndPullRequestsReq is request data for Client.IssuesAndPullRequests
https://developer.github.com/v3/search/#search-issues-and-pull-requests
Non-nil errors will have the type *requests.RequestError, octo.ResponseError or url.Error.
func (*IssuesAndPullRequestsReq) HTTPRequest ¶
func (r *IssuesAndPullRequestsReq) HTTPRequest(ctx context.Context, opt ...requests.Option) (*http.Request, error)
HTTPRequest builds an *http.Request. Non-nil errors will have the type *requests.RequestError.
func (*IssuesAndPullRequestsReq) Rel ¶
func (r *IssuesAndPullRequestsReq) Rel(link string, resp *IssuesAndPullRequestsResponse) bool
Rel updates this request to point to a relative link from resp. Returns false if the link does not exist. Handy for paging.
type IssuesAndPullRequestsResponse ¶
type IssuesAndPullRequestsResponse struct { Data IssuesAndPullRequestsResponseBody // contains filtered or unexported fields }
IssuesAndPullRequestsResponse is a response for IssuesAndPullRequests
https://developer.github.com/v3/search/#search-issues-and-pull-requests
func IssuesAndPullRequests ¶
func IssuesAndPullRequests(ctx context.Context, req *IssuesAndPullRequestsReq, opt ...requests.Option) (*IssuesAndPullRequestsResponse, error)
IssuesAndPullRequests performs requests for "search/issues-and-pull-requests"
Search issues and pull requests.
GET /search/issues
https://developer.github.com/v3/search/#search-issues-and-pull-requests
func (*IssuesAndPullRequestsResponse) HTTPResponse ¶
func (r *IssuesAndPullRequestsResponse) HTTPResponse() *http.Response
HTTPResponse returns the *http.Response
func (*IssuesAndPullRequestsResponse) ReadResponse ¶
func (r *IssuesAndPullRequestsResponse) ReadResponse(resp *http.Response) error
ReadResponse reads an *http.Response. Non-nil errors will have the type octo.ResponseError.
type IssuesAndPullRequestsResponseBody ¶
type IssuesAndPullRequestsResponseBody struct { IncompleteResults bool `json:"incomplete_results,omitempty"` Items []components.IssueSearchResultItem `json:"items,omitempty"` TotalCount int64 `json:"total_count,omitempty"` }
IssuesAndPullRequestsResponseBody is a response body for IssuesAndPullRequests
https://developer.github.com/v3/search/#search-issues-and-pull-requests
type LabelsReq ¶
type LabelsReq struct { // The id of the repository. RepositoryId *int64 /* The search keywords. This endpoint does not accept qualifiers in the query. To learn more about the format of the query, see [Constructing a search query](https://developer.github.com/v3/search/#constructing-a-search-query). */ Q *string /* Sorts the results of your query by when the label was `created` or `updated`. Default: [best match](https://developer.github.com/v3/search/#ranking-search-results) */ Sort *string /* Determines whether the first search result returned is the highest number of matches (`desc`) or lowest number of matches (`asc`). This parameter is ignored unless you provide `sort`. */ Order *string // contains filtered or unexported fields }
LabelsReq is request data for Client.Labels
https://developer.github.com/v3/search/#search-labels
Non-nil errors will have the type *requests.RequestError, octo.ResponseError or url.Error.
func (*LabelsReq) HTTPRequest ¶
HTTPRequest builds an *http.Request. Non-nil errors will have the type *requests.RequestError.
type LabelsResponse ¶
type LabelsResponse struct { Data LabelsResponseBody // contains filtered or unexported fields }
LabelsResponse is a response for Labels
https://developer.github.com/v3/search/#search-labels
func (*LabelsResponse) HTTPResponse ¶
func (r *LabelsResponse) HTTPResponse() *http.Response
HTTPResponse returns the *http.Response
func (*LabelsResponse) ReadResponse ¶
func (r *LabelsResponse) ReadResponse(resp *http.Response) error
ReadResponse reads an *http.Response. Non-nil errors will have the type octo.ResponseError.
type LabelsResponseBody ¶
type LabelsResponseBody struct { IncompleteResults bool `json:"incomplete_results,omitempty"` Items []components.LabelSearchResultItem `json:"items,omitempty"` TotalCount int64 `json:"total_count,omitempty"` }
LabelsResponseBody is a response body for Labels
type ReposReq ¶
type ReposReq struct { /* The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://developer.github.com/v3/search/#constructing-a-search-query). See "[Searching for repositories](https://help.github.com/articles/searching-for-repositories/)" for a detailed list of qualifiers. */ Q *string /* Sorts the results of your query by number of `stars`, `forks`, or `help-wanted-issues` or how recently the items were `updated`. Default: [best match](https://developer.github.com/v3/search/#ranking-search-results) */ Sort *string /* Determines whether the first search result returned is the highest number of matches (`desc`) or lowest number of matches (`asc`). This parameter is ignored unless you provide `sort`. */ Order *string // Results per page (max 100) PerPage *int64 // Page number of the results to fetch. Page *int64 /* The `topics` property for repositories on GitHub is currently available for developers to preview. To view the `topics` property in calls that return repository results, you must set this to true. */ MercyPreview bool // contains filtered or unexported fields }
ReposReq is request data for Client.Repos
https://developer.github.com/v3/search/#search-repositories
Non-nil errors will have the type *requests.RequestError, octo.ResponseError or url.Error.
func (*ReposReq) HTTPRequest ¶
HTTPRequest builds an *http.Request. Non-nil errors will have the type *requests.RequestError.
type ReposResponse ¶
type ReposResponse struct { Data ReposResponseBody // contains filtered or unexported fields }
ReposResponse is a response for Repos
https://developer.github.com/v3/search/#search-repositories
func Repos ¶
Repos performs requests for "search/repos"
Search repositories.
GET /search/repositories
func (*ReposResponse) HTTPResponse ¶
func (r *ReposResponse) HTTPResponse() *http.Response
HTTPResponse returns the *http.Response
func (*ReposResponse) ReadResponse ¶
func (r *ReposResponse) ReadResponse(resp *http.Response) error
ReadResponse reads an *http.Response. Non-nil errors will have the type octo.ResponseError.
type ReposResponseBody ¶
type ReposResponseBody struct { IncompleteResults bool `json:"incomplete_results,omitempty"` Items []components.RepoSearchResultItem `json:"items,omitempty"` TotalCount int64 `json:"total_count,omitempty"` }
ReposResponseBody is a response body for Repos
type TopicsReq ¶
type TopicsReq struct { /* The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://developer.github.com/v3/search/#constructing-a-search-query). */ Q *string /* The `topics` property for repositories on GitHub is currently available for developers to preview. To view the `topics` property in calls that return repository results, you must set this to true. */ MercyPreview bool // contains filtered or unexported fields }
TopicsReq is request data for Client.Topics
https://developer.github.com/v3/search/#search-topics
Non-nil errors will have the type *requests.RequestError, octo.ResponseError or url.Error.
func (*TopicsReq) HTTPRequest ¶
HTTPRequest builds an *http.Request. Non-nil errors will have the type *requests.RequestError.
type TopicsResponse ¶
type TopicsResponse struct { Data TopicsResponseBody // contains filtered or unexported fields }
TopicsResponse is a response for Topics
https://developer.github.com/v3/search/#search-topics
func (*TopicsResponse) HTTPResponse ¶
func (r *TopicsResponse) HTTPResponse() *http.Response
HTTPResponse returns the *http.Response
func (*TopicsResponse) ReadResponse ¶
func (r *TopicsResponse) ReadResponse(resp *http.Response) error
ReadResponse reads an *http.Response. Non-nil errors will have the type octo.ResponseError.
type TopicsResponseBody ¶
type TopicsResponseBody struct { IncompleteResults bool `json:"incomplete_results,omitempty"` Items []components.TopicSearchResultItem `json:"items,omitempty"` TotalCount int64 `json:"total_count,omitempty"` }
TopicsResponseBody is a response body for Topics
type UsersReq ¶
type UsersReq struct { /* The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub. The REST API supports the same qualifiers as GitHub.com. To learn more about the format of the query, see [Constructing a search query](https://developer.github.com/v3/search/#constructing-a-search-query). See "[Searching users](https://help.github.com/articles/searching-users/)" for a detailed list of qualifiers. */ Q *string /* Sorts the results of your query by number of `followers` or `repositories`, or when the person `joined` GitHub. Default: [best match](https://developer.github.com/v3/search/#ranking-search-results) */ Sort *string /* Determines whether the first search result returned is the highest number of matches (`desc`) or lowest number of matches (`asc`). This parameter is ignored unless you provide `sort`. */ Order *string // Results per page (max 100) PerPage *int64 // Page number of the results to fetch. Page *int64 // contains filtered or unexported fields }
UsersReq is request data for Client.Users
https://developer.github.com/v3/search/#search-users
Non-nil errors will have the type *requests.RequestError, octo.ResponseError or url.Error.
func (*UsersReq) HTTPRequest ¶
HTTPRequest builds an *http.Request. Non-nil errors will have the type *requests.RequestError.
type UsersResponse ¶
type UsersResponse struct { Data UsersResponseBody // contains filtered or unexported fields }
UsersResponse is a response for Users
https://developer.github.com/v3/search/#search-users
func (*UsersResponse) HTTPResponse ¶
func (r *UsersResponse) HTTPResponse() *http.Response
HTTPResponse returns the *http.Response
func (*UsersResponse) ReadResponse ¶
func (r *UsersResponse) ReadResponse(resp *http.Response) error
ReadResponse reads an *http.Response. Non-nil errors will have the type octo.ResponseError.
type UsersResponseBody ¶
type UsersResponseBody struct { IncompleteResults bool `json:"incomplete_results,omitempty"` Items []components.UserSearchResultItem `json:"items,omitempty"` TotalCount int64 `json:"total_count,omitempty"` }
UsersResponseBody is a response body for Users