You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

user_search.go 374B

1234567891011121314
  1. package gitea
  2. import "fmt"
  3. type searchUsersResponse struct {
  4. Users []*User `json:"data"`
  5. }
  6. // SearchUsers finds users by query
  7. func (c *Client) SearchUsers(query string, limit int) ([]*User, error) {
  8. resp := new(searchUsersResponse)
  9. err := c.getParsedResponse("GET", fmt.Sprintf("/users/search?q=%s&limit=%d", query, limit), nil, nil, &resp)
  10. return resp.Users, err
  11. }