-
Notifications
You must be signed in to change notification settings - Fork 3
/
user.go
66 lines (58 loc) · 2.07 KB
/
user.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
package entities
import "time"
type User struct {
ID string `json:"id"`
Name string `json:"name"`
UserName string `json:"username"`
CreatedAt time.Time `json:"created_at,omitempty"`
Description string `json:"description,omitempty"`
Entities UserEntities `json:"entities,omitempty"`
Location string `json:"location,omitempty"`
PinnedTweetID string `json:"pinned_tweet_id,omitempty"`
ProfileImageURL string `json:"profile_image_url,omitempty"`
Protected bool `json:"protected,omitempty"`
PublicMetrics UserPublicMetrics `json:"public_metrics,omitempty"`
URL string `json:"url,omitempty"`
Verified bool `json:"verified,omitempty"`
Withheld UserWithheld `json:"withheld,omitempty"`
}
type UserEntities struct {
URL UserURL `json:"url"`
Description UserDescription `json:"description"`
}
type UserURL struct {
URLs []struct {
Start int `json:"start"`
End int `json:"end"`
URL string `json:"url"`
ExpandedURL string `json:"expanded_url"`
DisplayURL string `json:"display_url"`
} `json:"urls"`
}
type UserDescription struct {
URLs []struct {
Start int `json:"start"`
End int `json:"end"`
URL string `json:"url"`
ExpandedURL string `json:"expanded_url"`
DisplayURL string `json:"display_url"`
} `json:"urls"`
HashTags []UserEntityTag `json:"hashtags"`
Mentions []UserEntities `json:"mentions"`
CashTags []UserEntityTag `json:"cashtags"`
}
type UserEntityTag struct {
Start int `json:"start"`
End int `json:"end"`
Tag string `json:"tag"`
}
type UserPublicMetrics struct {
FollowersCount int `json:"followers_count"`
FollowingCount int `json:"following_count"`
TweetCount int `json:"tweet_count"`
ListedCount int `json:"listed_count"`
}
type UserWithheld struct {
Copyright bool `json:"copyright"`
CountryCodes []string `json:"country_codes"`
}