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.go 595B

123456789101112131415161718192021222324
  1. // Copyright 2014 The Gogs Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package gitea
  5. import (
  6. "fmt"
  7. )
  8. // User represents a API user.
  9. type User struct {
  10. ID int64 `json:"id"`
  11. UserName string `json:"username"`
  12. FullName string `json:"full_name"`
  13. Email string `json:"email"`
  14. AvatarUrl string `json:"avatar_url"`
  15. }
  16. func (c *Client) GetUserInfo(user string) (*User, error) {
  17. u := new(User)
  18. err := c.getParsedResponse("GET", fmt.Sprintf("/users/%s", user), nil, nil, u)
  19. return u, err
  20. }