forgejo-sdk/user.go

25 lines
595 B
Go
Raw Normal View History

2014-11-14 22:07:41 +00:00
// 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 14:34:27 +01:00
package gitea
2014-11-14 22:07:41 +00:00
import (
"fmt"
)
2014-11-14 22:07:41 +00:00
// User represents a API user.
type User struct {
2015-08-18 22:28:20 +01:00
ID int64 `json:"id"`
2014-11-14 22:07:41 +00:00
UserName string `json:"username"`
FullName string `json:"full_name"`
Email string `json:"email"`
2014-11-14 22:07:41 +00:00
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
}