Documentation
¶
Overview ¶
Package tweets provides functionality around reading and writing tweets.
Package tweets provides functionality around reading and writing tweets.
Package tweets provides functionality around reading and writing tweets.
Index ¶
Constants ¶
View Source
const (
// DBName is the name of the database for the tweets API.
DBName = "tweets"
)
Variables ¶
This section is empty.
Functions ¶
func CreateEmojisTableIfNotExist ¶
CreateEmojisTableIfNotExist creates the "emojis" table if it does not exist already.
func CreateTweetsTableIfNotExist ¶
CreateTweetsTableIfNotExist creates the "tweets" table if it does not exist already.
Types ¶
type DB ¶
type DB interface { StoreTweet(id, username, tweetContent, createdAt, metadata string) error ExistTweet(id string) (bool, error) StoreEmoji(id, emoji string) error EmojiResults() partialQuery }
DB is the interface for all the operations allowed on tweets.
type EmojiCount ¶
EmojiCount is a pair of a emoji and the count of occurrences of emoji.
type EmojisController ¶
type EmojisController interface {
EmojiResults() ([]EmojiCount, error)
}
func NewEmojisController ¶
func NewEmojisController(db DB) EmojisController
type Tweet ¶
type Tweet struct { ID string `json:"id"` Username string `json:"username"` TweetContent string `json:"tweet_content"` Metadata TweetMetdata `json:"metadata"` }
type TweetMetdata ¶
type TweetsController ¶
func NewTweetsController ¶
func NewTweetsController(db DB) TweetsController
Click to show internal directories.
Click to hide internal directories.