forked from ktrysmt/go-bitbucket
-
Notifications
You must be signed in to change notification settings - Fork 0
/
users.go
31 lines (24 loc) · 768 Bytes
/
users.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package bitbucket
type Users struct {
c *Client
}
func (u *Users) Get(t string) (*User, error) {
urlStr := u.c.GetApiBaseURL() + "/users/" + t + "/"
response, err := u.c.execute("GET", urlStr, "")
if err != nil {
return nil, err
}
return decodeUser(response)
}
func (u *Users) Followers(t string) (interface{}, error) {
urlStr := u.c.GetApiBaseURL() + "/users/" + t + "/followers"
return u.c.execute("GET", urlStr, "")
}
func (u *Users) Following(t string) (interface{}, error) {
urlStr := u.c.GetApiBaseURL() + "/users/" + t + "/following"
return u.c.execute("GET", urlStr, "")
}
func (u *Users) Repositories(t string) (interface{}, error) {
urlStr := u.c.GetApiBaseURL() + "/users/" + t + "/repositories"
return u.c.execute("GET", urlStr, "")
}