go-sdk/user.go

25 lines
595 B
Go
Raw Normal View History

2014-11-15 03:37:41 +05:30
// Copyright 2014 The Gogs Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
2015-08-26 19:04:27 +05:30
package gitea
2014-11-15 03:37:41 +05:30
import (
"fmt"
)
2014-11-15 03:37:41 +05:30
// User represents a API user.
type User struct {
2015-08-19 02:58:20 +05:30
ID int64 `json:"id"`
2014-11-15 03:37:41 +05:30
UserName string `json:"username"`
FullName string `json:"full_name"`
Email string `json:"email"`
2014-11-15 03:37:41 +05:30
AvatarUrl string `json:"avatar_url"`
}
func (c *Client) GetUserInfo(user string) (*User, error) {
u := new(User)
err := c.getParsedResponse("GET", fmt.Sprintf("/users/%s", user), nil, nil, u)
return u, err
}