Documentation ¶
Index ¶
- func CreateConnection(dburl string) error
- func CreateTweetPair(tx *sql.Tx, tweet1IDStr string, tweet2IDStr string) (pair model.TweetPair, err error)
- func GetMostRecentTweet(tx *sql.Tx, author model.TweetAuthor, before time.Time) (t model.DBTweet, err error)
- func GetNewerTweet(tx *sql.Tx, tweet model.DBTweet, author model.TweetAuthor) (t model.DBTweet, err error)
- func GetOlderTweet(tx *sql.Tx, tweet model.DBTweet, author model.TweetAuthor) (t model.DBTweet, err error)
- func GetTweetPairByShortID(tx *sql.Tx, shortID string) (pair model.TweetPair, err error)
- func GetTweetPairByTweets(tx *sql.Tx, tweet1IDStr string, tweet2IDStr string) (pair model.TweetPair, err error)
- func GetTweetsFromIDs(tx *sql.Tx, StrIDs []string) (tweetMap map[string]model.DBTweet, err error)
- func InsertTweet(tx *sql.Tx, tw model.DBTweet) error
- func NewTransaction() (tx *sql.Tx, err error)
- func RunMigrations() (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateConnection ¶
CreateConnection creates a re-useable global database connection
func CreateTweetPair ¶
func CreateTweetPair(tx *sql.Tx, tweet1IDStr string, tweet2IDStr string) (pair model.TweetPair, err error)
CreateTweetPair creates a new pair given the two tweet IDs, if necessary
func GetMostRecentTweet ¶
func GetMostRecentTweet(tx *sql.Tx, author model.TweetAuthor, before time.Time) (t model.DBTweet, err error)
GetMostRecentTweet recovers the most recent tweet for a given presidential author
func GetNewerTweet ¶
func GetNewerTweet(tx *sql.Tx, tweet model.DBTweet, author model.TweetAuthor) (t model.DBTweet, err error)
GetNewerTweet recovers the next newest tweet by the same author
func GetOlderTweet ¶
func GetOlderTweet(tx *sql.Tx, tweet model.DBTweet, author model.TweetAuthor) (t model.DBTweet, err error)
GetOlderTweet recovers the next oldest tweet by the same author
func GetTweetPairByShortID ¶
GetTweetPairByShortID looks up a tweet pair by the pair's short ID
func GetTweetPairByTweets ¶
func GetTweetPairByTweets(tx *sql.Tx, tweet1IDStr string, tweet2IDStr string) (pair model.TweetPair, err error)
GetTweetPairByTweets looks up a tweet pair by its two constituent tweets
func GetTweetsFromIDs ¶
GetTweetsFromIDs recovers any tweets available for the given IDs
func InsertTweet ¶
InsertTweet inserts a tweet into the transaction
func NewTransaction ¶
NewTransaction creates a new transaction in the global database
func RunMigrations ¶
func RunMigrations() (err error)
RunMigrations attempts to run database migrations on the global database
Types ¶
This section is empty.