db

package
v0.0.0-...-00e40af Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 11, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AlreadyFollow

func AlreadyFollow(userId int64) (bool, error)

func GenerateCryptoRandInt

func GenerateCryptoRandInt(max int) (int, error)

func GenerateCryptoRandIntForFavorite

func GenerateCryptoRandIntForFavorite(max int) (int, error)

func GetNumberOfTweetsBetweenDates

func GetNumberOfTweetsBetweenDates(from time.Time, to time.Time) (int, error)

func HasAlreadyFav

func HasAlreadyFav(tweetId int64) (bool, error)

func HasAlreadyReplied

func HasAlreadyReplied(tweetId int64) (bool, error)

func HasTweetWithContent

func HasTweetWithContent(content string) (bool, error)

func Init

func Init() (*sql.DB, error)

Types

type Favorite

type Favorite struct {
	UserId     int64
	UserName   string
	TweetId    int64
	Status     string
	FavDate    time.Time
	UnfavDate  time.Time
	LastAction time.Time
	// contains filtered or unexported fields
}

func GetNotUnfavorite

func GetNotUnfavorite(maxFavDate time.Time, limit int) ([]Favorite, error)

func (Favorite) Persist

func (fav Favorite) Persist() error

type Follow

type Follow struct {
	UserId       int64
	UserName     string
	TweetId      int64
	Status       string
	FollowDate   time.Time
	UnfollowDate time.Time
	LastAction   time.Time
	// contains filtered or unexported fields
}

func GetNotUnfollowed

func GetNotUnfollowed(maxFollowDate time.Time, limit int) ([]Follow, error)

func (Follow) Persist

func (follow Follow) Persist() error

type Reply

type Reply struct {
	ID        int
	UserId    int64
	UserName  string
	TweetId   int64
	Status    string
	Answer    string
	ReplyDate time.Time
}

func (Reply) Persist

func (reply Reply) Persist() error

type Tweet

type Tweet struct {
	ID      int
	Content string
	Date    time.Time
}

func (Tweet) Persist

func (tweet Tweet) Persist() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL