diff options
Diffstat (limited to 'vendor/code.gitea.io/sdk/gitea/user_search.go')
-rw-r--r-- | vendor/code.gitea.io/sdk/gitea/user_search.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/vendor/code.gitea.io/sdk/gitea/user_search.go b/vendor/code.gitea.io/sdk/gitea/user_search.go new file mode 100644 index 0000000000..65ab980d66 --- /dev/null +++ b/vendor/code.gitea.io/sdk/gitea/user_search.go @@ -0,0 +1,14 @@ +package gitea + +import "fmt" + +type searchUsersResponse struct { + Users []*User `json:"data"` +} + +// SearchUsers finds users by query +func (c *Client) SearchUsers(query string, limit int) ([]*User, error) { + resp := new(searchUsersResponse) + err := c.getParsedResponse("GET", fmt.Sprintf("/users/search?q=%s&limit=%d", query, limit), nil, nil, &resp) + return resp.Users, err +} |