0
0
mirror of https://github.com/thegeeklab/wp-gitea-release.git synced 2024-11-13 22:50:42 +00:00
wp-gitea-release/vendor/code.gitea.io/sdk/gitea/user_search.go
Jonas Franz 88dc55b2e7
Add missing dependencies
Signed-off-by: Jonas Franz <info@jonasfranz.software>
2018-03-02 23:54:25 +01:00

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
}