Documentation
¶
Index ¶
- type Comment
- type DbModel
- func (m *DbModel) CheckGenre(Genreid int) (bool, error)
- func (m *DbModel) CheckRating(movieID, userID int) (int, error)
- func (m *DbModel) DeleteGenre(id int) error
- func (m *DbModel) GetAllGenres() ([]*Genre, error)
- func (m *DbModel) GetAllMovies() ([]*Movie, error)
- func (m *DbModel) GetGenreByID(id int) (*Genre, error)
- func (m *DbModel) GetLatestMovies(userID ...int) ([]*Movie, error)
- func (m *DbModel) GetMovie(id int) (*Movie, error)
- func (m *DbModel) GetMoviesByGenre(genreID int) ([]*Movie, error)
- func (m *DbModel) GetUserByEmail(email string) (*User, error)
- func (m *DbModel) InsertGenre(Genrename string) (int, error)
- func (m *DbModel) InsertRating(rating *Rating) (int, error)
- func (m *DbModel) InsertUser(name, email, password string) error
- func (m *DbModel) UpdateGenre(id int, GenreName string) (int, error)
- func (m *DbModel) UpdateRating(rating *Rating) (int, error)
- type Favorite
- type Genre
- type Image
- type Model
- type Movie
- type MovieFilter
- type MovieGenre
- type PaginatedMovies
- type QueryParam
- type Rating
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Comment ¶
type Comment struct { ID int `json:"id"` UserID int `json:"user_id"` UserName string `json:"user_name"` MovieID int `json:"movie_id,omitempty"` Comment string `json:"comment"` CreatedAt time.Time `json:"-"` UpdatedAt time.Time `json:"commented_at"` }
model for comment
type DbModel ¶
databse structure
func (*DbModel) CheckRating ¶
Check rating
func (*DbModel) DeleteGenre ¶
func (*DbModel) GetAllGenres ¶
getting all genres
func (*DbModel) GetAllMovies ¶
func (*DbModel) GetGenreByID ¶
getting gerne by id
func (*DbModel) GetLatestMovies ¶
get latest Movies Featured on the website
func (*DbModel) GetMoviesByGenre ¶
func (*DbModel) GetUserByEmail ¶
GetUserByEmail gets user by email
func (*DbModel) InsertRating ¶
InsertRating inserts a new rating into the database
func (*DbModel) InsertUser ¶
type Favorite ¶
type Favorite struct { ID int `json:"id"` UserID int `json:"user_id"` MovieID int `json:"movie_id"` CreatedAt time.Time `json:"-"` UpdatedAt time.Time `json:"fav_at"` }
model for favorite
type Genre ¶
type Genre struct { ID int `json:"id"` GenreName string `json:"genre_name"` CreatedAt time.Time `json:"-"` UpdatedAt time.Time `json:"-"` }
Genre is the type for genre table
type Image ¶
type Image struct { ID int `json:"id"` UserID int `json:"user_id"` ImagePath string `json:"image_path"` ImageName string `json:"image_name"` IsUsed bool `json:"is_used"` CreatedAt time.Time `json:"-"` UpdatedAt time.Time `json:"-"` }
model for Image
type Model ¶
type Model struct { Db DbModel Cld *cloudinary.Cloudinary }
model structure- Wrapper Class for Database
func CreateModel ¶
type Movie ¶
type Movie struct { ID int `json:"id"` Title string `json:"title"` Description string `json:"description"` Year int `json:"year"` ReleaseDate time.Time `json:"release_date"` Runtime int `json:"runtime"` Rating float64 `json:"rating"` Ratings []Rating `json:"ratings,omitempty"` // this is for movie details TotalFavorites int `json:"total_favorites"` // this is for movie details IsFavorite bool `json:"is_favorite"` Favorites []Favorite `json:"favorites,omitempty"` TotalComments int `json:"total_comments"` Comments []Comment `json:"comments,omitempty"` // this is for movie details MovieGenre map[int]string `json:"genres"` // this is for movie details Image string `json:"image"` CreatedAt time.Time `json:"-"` UpdatedAt time.Time `json:"-"` }
Movie structure
type MovieFilter ¶
Filter for Organising Movies
type MovieGenre ¶
type MovieGenre struct { ID int `json:"-"` MovieID int `json:"-"` GenreID int `json:"-"` Genre Genre `json:"genre"` CreatedAt time.Time `json:"-"` UpdatedAt time.Time `json:"-"` }
MovieGenre is the type for movie genre table
type PaginatedMovies ¶
type PaginatedMovies struct { TotalCount int `json:"total_count"` PerPage int `json:"per_page"` CurrentPage int `json:"current_page"` Movies []*Movie `json:"movies"` }
Model for movies response
type QueryParam ¶
type QueryParam struct { Key string Value interface{} }
query params helps to organize query parameters struct for query parameters
Click to show internal directories.
Click to hide internal directories.