Documentation
¶
Index ¶
- func CheckUserEmailExists(email string) (bool, error)
- func ConnectDB(connectString string) error
- func DeleteReviewRating(titleId, userId uint64) error
- func DeleteTitle(titleId uint64) error
- func InitUserSessions(key []byte)
- func InsertOnlyRating(rating int, titleId, userId uint64) (uint64, error)
- func InsertReview(rating int, reviewTitle, review string, titleId, userId uint64) (uint64, error)
- func InsertTitle(titleTitle, translatedTitle, typeChar, genre string, ageRatingId uint64, ...) (uint64, error)
- func Login(r *http.Request, w http.ResponseWriter, userId uint64) error
- func Logout(r *http.Request, w http.ResponseWriter) error
- func RegisterUser(email, username, password string) (uint64, error)
- func UpdateReviewRating(rating int, reviewTitle, review string, titleId, userId uint64) (uint64, error)
- func UpdateTitle(titleId uint64, titleTitle, translatedTitle, typeChar, genre string, ...) (uint64, error)
- type ReviewRating
- type Title
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckUserEmailExists ¶
func DeleteReviewRating ¶
func DeleteTitle ¶
func InitUserSessions ¶
func InitUserSessions(key []byte)
func InsertReview ¶
func InsertTitle ¶
func RegisterUser ¶
func UpdateReviewRating ¶
Types ¶
type ReviewRating ¶
type ReviewRating struct {
Id uint64 `db:"id"`
Value int `db:"value"`
SiteUserId uint64 `db:"site_user_id"`
TitleId uint64 `db:"title_id"`
ReviewTitle string `db:"review_title"`
Review string `db:"review"`
Username string `db:"username"`
}
func GetAllReviewsForTitleByTitleId ¶
func GetAllReviewsForTitleByTitleId(titleId uint64) ([]ReviewRating, error)
func GetReviewRatingByUserId ¶
func GetReviewRatingByUserId(titleId, userId uint64) (bool, ReviewRating, error)
type Title ¶
type Title struct {
Id uint64 `db:"id"`
Type string `db:"type"`
TypeChar string `db:"type_char"`
Title string `db:"title"`
TranslatedTitle string `db:"translated_title"`
PremierDate time.Time `db:"premier_date"`
Genre string `db:"genre"`
AgeRatingId uint64 `db:"age_rating_id"`
AgeRating string `db:"age_rating"`
Duration string `db:"duration"`
Description string `db:"description"`
Country string `db:"country"`
NumberOfEpisodes int `db:"number_of_episodes"`
NumberOfSeasons int `db:"number_of_seasons"`
RatingAvg string `db:"rating_avg"`
RatingCnt int `db:"rating_cnt"`
RatingReviews int `db:"rating_reviews"`
DurationFormatted string
}
func FilterTitles ¶
func GetAllTitles ¶
func GetTitleById ¶
func (*Title) ConvertDuration ¶
func (t *Title) ConvertDuration()
type User ¶
type User struct {
Id uint64 `db:"id"`
Email string `db:"email"`
Username string `db:"username"`
PasswordHash string `db:"password_hash"`
IsAdmin bool `db:"is_admin"`
}
func GetUserByEmail ¶
func GetUserById ¶
func IsUserLoggedIn ¶
func (*User) CheckPassword ¶
Click to show internal directories.
Click to hide internal directories.