Documentation
¶
Overview ¶
Package service is the service layer of the turdus project
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExtendedTweet ¶
type ExtendedTweet struct {
FullText string `json:"full_text"`
}
ExtendedTweet represents a extended tweet unitary structure
type Tweet ¶
type Tweet struct {
CreatedAt string `json:"created_at"`
ID int `json:"id"`
Text string `json:"text"`
FavoriteCount int `json:"favorite_count"`
RetweetCount int `json:"retweet_count"`
ExtendedTweet ExtendedTweet `json:"extended_tweet"`
}
Tweet represents a tweet unitary structure
type TweetPayload ¶
type TweetPayload struct {
Query string `json:"query"`
MaxResults int `json:"maxResults"`
FromDate string `json:"fromDate"`
ToDate string `json:"toDate"`
Next string `json:"next,omitempty"` // Informs if has next page
}
TweetPayload is the payload to sent to twitter api
type TweetResponse ¶
type TweetResponse struct {
Results []Tweet `json:"results"`
Next string `json:"next,omitempty"` // Informs if has next page
}
TweetResponse is the twitter api response
type TwitterService ¶
TwitterService represents the twitter service structure
func NewTwitterService ¶
func NewTwitterService() TwitterService
NewTwitterService is a TwitterService constructor
func (TwitterService) GetTweets ¶
func (svc TwitterService) GetTweets(author, fromDate, toDate, nextPage string) (*TweetResponse, error)
GetTweets retrieve tweets from the twitter api given specific search
Click to show internal directories.
Click to hide internal directories.