summaryrefslogtreecommitdiffstats
path: root/vendor/code.gitea.io/sdk/gitea/user_search.go
blob: 65ab980d66f868bd97e504bf0f14fcba7904dc43 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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
}