Documentation
¶
Overview ¶
Package model of twitter
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
TwitterDB mongo.DB
)
Functions ¶
func Initialize ¶
Types ¶
type EmbededTweet ¶
type EmbededTweet struct { MongoID primitive.ObjectID `bson:"_id,omitempty" json:"mongo_id"` ID string `bson:"id_str" json:"id"` CreatedAt string `bson:"created_at" json:"created_at"` Text string `bson:"full_text" json:"text"` Topics []string `bson:"topics" json:"topics"` User *User `bson:"user" json:"user"` ReplyToStatusID string `bson:"in_reply_to_status_id_str" json:"in_reply_to_status_id"` Entities *Entities `bson:"entities" json:"entities"` IsRetweeted bool `bson:"retweeted" json:"is_retweeted"` RetweetedTweet *EmbededTweet `bson:"retweeted_status,omitempty" json:"retweeted_tweet"` IsQuoted bool `bson:"is_quote_status" json:"is_quote_status"` QuotedTweet *EmbededTweet `bson:"quoted_status,omitempty" json:"quoted_status"` Viewer []int64 `bson:"viewer,omitempty" json:"viewer"` }
func (*EmbededTweet) ToTweet ¶
func (t *EmbededTweet) ToTweet() (tweet *Tweet, err error)
type SearchTweet ¶
type SearchTweet struct { TweetID string `gorm:"column:tweet_id" json:"tweet_id"` Text string `gorm:"column:text" json:"text"` UserID string `gorm:"column:user_id" json:"user_id"` CreatedAt *time.Time `gorm:"column:created_at" json:"created_at"` }
func (SearchTweet) TableName ¶
func (SearchTweet) TableName() string
type Tweet ¶
type Tweet struct { MongoID primitive.ObjectID `bson:"_id,omitempty" json:"mongo_id"` ID string `bson:"id_str" json:"id"` CreatedAt time.Time `bson:"created_at" json:"created_at"` Text string `bson:"text" json:"text"` Topics []string `bson:"topics" json:"topics"` User *User `bson:"user" json:"user"` ReplyToStatusID string `bson:"in_reply_to_status_id_str" json:"in_reply_to_status_id"` Entities *Entities `bson:"entities" json:"entities"` IsRetweeted bool `bson:"retweeted" json:"is_retweeted"` RetweetedTweet *EmbededTweet `bson:"retweeted_status,omitempty" json:"retweeted_tweet"` IsQuoted bool `bson:"is_quote_status" json:"is_quote_status"` QuotedTweet *EmbededTweet `bson:"quoted_status,omitempty" json:"quoted_status"` Viewer []int64 `bson:"viewer,omitempty" json:"viewer"` }
Click to show internal directories.
Click to hide internal directories.