-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path03-types.go
68 lines (62 loc) · 2.25 KB
/
03-types.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
67
68
package quitter
// Account is credentials needed for logging in. Set it with NewAccount()
type Account struct {
Username string
Password string
Node string
Scheme string
Proxy string
}
// NewAccount sets the authentication method and choose node.
// It does NOT register a new account on a node.
func NewAccount() *Account {
return &Account{
Username: "gopher",
Password: "password",
Node: "example.org",
Scheme: "https://",
}
}
// User is a GNU Social User, gets returned by GS API
type User struct {
Name string `json:"name"`
Screenname string `json:"screen_name"`
}
// Quip is a GNU Social Quip, gets returned by GS API.
type Quip struct {
ID int64 `json:"id"`
IDStr string `json:"id_str"`
InReplyToScreenName string `json:"in_reply_to_screen_name"`
InReplyToStatusID int64 `json:"in_reply_to_status_id"`
InReplyToStatusIDStr string `json:"in_reply_to_status_id_str"`
InReplyToUserID int64 `json:"in_reply_to_user_id"`
InReplyToUserIDStr string `json:"in_reply_to_user_id_str"`
Lang string `json:"lang"`
Place string `json:"place"`
PossiblySensitive bool `json:"possibly_sensitive"`
RetweetCount int `json:"retweet_count"`
Retweeted bool `json:"retweeted"`
RetweetedStatus *Quip `json:"retweeted_status"`
Source string `json:"source"`
Text string `json:"text"`
Truncated bool `json:"truncated"`
User User `json:"user"`
WithheldCopyright bool `json:"withheld_copyright"`
WithheldInCountries []string `json:"withheld_in_countries"`
WithheldScope string `json:"withheld_scope"`
}
// Group is a GNU Social Group, gets returned by GS API.
type Group struct {
ID int64 `json:"id"`
URL string `json:"url"`
Nickname string `json:"nickname"`
Fullname string `json:"fullname"`
Member bool `json:"member"`
Membercount int64 `json:"member_count"`
Description string `json:"description"`
}
// Badrequest is an error. If the API doesn't respond how we like, it replies using this struct (in json)
type Badrequest struct {
Error string `json:"error"`
Request string `json:"request"`
}