Documentation ¶
Overview ¶
Package twitter implements twitter sync task.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ClickhouseDao ¶
type ClickhouseDao struct {
// contains filtered or unexported fields
}
func NewSearchDao ¶
func NewSearchDao(dsn string) (*ClickhouseDao, error)
func (*ClickhouseDao) GetLargestID ¶
func (d *ClickhouseDao) GetLargestID() (string, error)
GetLargestID returns the largest id of tweets
do not use this API, twitter's id is not monotonical
func (*ClickhouseDao) GetLatestCreatedAt ¶
func (d *ClickhouseDao) GetLatestCreatedAt() (time.Time, error)
func (*ClickhouseDao) SaveTweet ¶
func (d *ClickhouseDao) SaveTweet(tweet ClickhouseTweet) error
type ClickhouseTweet ¶
type ClickhouseTweet 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 (ClickhouseTweet) TableName ¶
func (ClickhouseTweet) TableName() string
type ElasticsearchDao ¶
type ElasticsearchDao struct {
// contains filtered or unexported fields
}
func (*ElasticsearchDao) GetLargestID ¶
func (d *ElasticsearchDao) GetLargestID(ctx context.Context) (largestID float64, err error)
Click to show internal directories.
Click to hide internal directories.