mirror of
https://gitea.com/gitea/tea.git
synced 2024-11-25 20:11:36 +01:00
d4f107b710
* add Makefile / .drone.yml, use go module with vendor * Update .drone.yml Co-Authored-By: lunny <xiaolunwen@gmail.com>
15 lines
374 B
Go
15 lines
374 B
Go
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
|
|
}
|