Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidUser = errors.New("invalid user")
ErrInvalidUser represents invalid user error.
Functions ¶
This section is empty.
Types ¶
type Tweet ¶
type Tweet struct { Source string `json:"source" bson:"source" example:"Twitter Web Client"` ID string `json:"id" bson:"id" example:"4629116949"` Text string `json:"text" bson:"text" example:"- Read what Donald Trump has to say about daughter ..."` CreateTime time.Time `json:"create_time" bson:"create_time" example:"2009-10-05T14:37:38.000Z"` Retweets int64 `json:"retweets" bson:"retweets" example:"1"` ReplyUserID *string `json:"reply_user_id" bson:"reply_user_id" example:"996852" extensions:"x-nullable"` Favorites int64 `json:"favorites" bson:"favorites" example:"4"` IsRetweet bool `json:"is_retweet" bson:"is_retweet" example:"false"` }
Tweet represents a tweet.
func (*Tweet) MarshalLogObject ¶
func (twt *Tweet) MarshalLogObject(enc zapcore.ObjectEncoder) error
MarshalLogObject marshals tweet.
type Tweets ¶
type Tweets []*Tweet
Tweets represents a list of tweets.
func (Tweets) MarshalLogArray ¶
func (twts Tweets) MarshalLogArray(enc zapcore.ArrayEncoder) error
func (Tweets) SortByFavorites ¶
func (twts Tweets) SortByFavorites()
SortByFavorites sorts tweets by favorites count.
func (Tweets) SortByRetweets ¶
func (twts Tweets) SortByRetweets()
SortByRetweets sorts tweets by retweets count.
Click to show internal directories.
Click to hide internal directories.