implement structs

pull/10/head
Yasuhiro Matsumoto 2017-04-15 00:10:04 +09:00
parent aa81cb8318
commit 746688274d
1 changed files with 44 additions and 20 deletions

View File

@ -113,28 +113,52 @@ type Toot struct {
Visibility string `json:"visibility"` Visibility string `json:"visibility"`
} }
// Mention hold information for mention.
type Mention struct {
URL string `json:"url"`
Username string `json:"username"`
Acct string `json:"acct"`
ID int64 `json:"id"`
}
// Tag hold information for tag.
type Tag struct {
Name string `json:"name"`
URL string `json:"url"`
}
// Attachment hold information for attachment.
type Attachment struct {
ID int64 `json:"id"`
Type string `json:"type"`
URL string `json:"url"`
RemoteURL string `json:"remote_url"`
PreviewURL string `json:"preview_url"`
TextURL string `json:"text_url"`
}
// Status is struct to hold status. // Status is struct to hold status.
type Status struct { type Status struct {
ID int64 `json:"id"` ID int64 `json:"id"`
CreatedAt time.Time `json:"created_at"` CreatedAt time.Time `json:"created_at"`
InReplyToID interface{} `json:"in_reply_to_id"` InReplyToID interface{} `json:"in_reply_to_id"`
InReplyToAccountID interface{} `json:"in_reply_to_account_id"` InReplyToAccountID interface{} `json:"in_reply_to_account_id"`
Sensitive bool `json:"sensitive"` Sensitive bool `json:"sensitive"`
SpoilerText string `json:"spoiler_text"` SpoilerText string `json:"spoiler_text"`
Visibility string `json:"visibility"` Visibility string `json:"visibility"`
Application interface{} `json:"application"` Application Application `json:"application"`
Account Account `json:"account"` Account Account `json:"account"`
MediaAttachments []interface{} `json:"media_attachments"` MediaAttachments []Attachment `json:"media_attachments"`
Mentions []interface{} `json:"mentions"` Mentions []Mention `json:"mentions"`
Tags []interface{} `json:"tags"` Tags []Tag `json:"tags"`
URI string `json:"uri"` URI string `json:"uri"`
Content string `json:"content"` Content string `json:"content"`
URL string `json:"url"` URL string `json:"url"`
ReblogsCount int64 `json:"reblogs_count"` ReblogsCount int64 `json:"reblogs_count"`
FavouritesCount int64 `json:"favourites_count"` FavouritesCount int64 `json:"favourites_count"`
Reblog interface{} `json:"reblog"` Reblog *Status `json:"reblog"`
Favourited interface{} `json:"favourited"` Favourited interface{} `json:"favourited"`
Reblogged interface{} `json:"reblogged"` Reblogged interface{} `json:"reblogged"`
} }
// GetTimelineHome return statuses from home timeline. // GetTimelineHome return statuses from home timeline.