Add Pagination Options for List Requests #205
|
@ -91,6 +91,7 @@ func (c *Client) ListOrgRepos(org string, opt ListOrgReposOptions) ([]*Repositor
|
|||
// SearchRepoOptions options for searching repositories
|
||||
type SearchRepoOptions struct {
|
||||
// https://try.gitea.io/api/swagger#/repository/repoSearch
|
||||
ListOptions
|
||||
Keyword string
|
||||
Topic bool
|
||||
IncludeDesc bool
|
||||
|
@ -106,7 +107,7 @@ type SearchRepoOptions struct {
|
|||
|
||||
// QueryEncode turns options into querystring argument
|
||||
func (opt *SearchRepoOptions) QueryEncode() string {
|
||||
query := make(url.Values)
|
||||
query := opt.getURLQuery()
|
||||
if opt.Keyword != "" {
|
||||
query.Add("q", opt.Keyword)
|
||||
}
|
||||
|
@ -148,6 +149,7 @@ type searchRepoResponse struct {
|
|||
|
||||
// SearchRepos searches for repositories matching the given filters
|
||||
func (c *Client) SearchRepos(opt SearchRepoOptions) ([]*Repository, error) {
|
||||
opt.setDefaults()
|
||||
resp := new(searchRepoResponse)
|
||||
|
||||
link, _ := url.Parse("/repos/search")
|
||||
|
|
Loading…
Reference in New Issue
Block a user