Documentation ¶
Index ¶
- Variables
- type Handler
- func (h *Handler) AddMovieToWatchlist(w http.ResponseWriter, r *http.Request)
- func (h *Handler) CreateWatchlist(w http.ResponseWriter, r *http.Request)
- func (h *Handler) DeleteMovieInWatchlist(w http.ResponseWriter, r *http.Request)
- func (h *Handler) DeleteWatchlist(w http.ResponseWriter, r *http.Request)
- func (h *Handler) GetAllMoviesInWatchlist(w http.ResponseWriter, r *http.Request)
- func (h *Handler) GetAllWatchlistByUserId(w http.ResponseWriter, r *http.Request)
- func (h *Handler) GetWatchlistById(w http.ResponseWriter, r *http.Request)
- func (h *Handler) Routes() []router.Route
- func (h *Handler) UpdateStatusWatchList(w http.ResponseWriter, r *http.Request)
- type MongoDBRepository
- func (r *MongoDBRepository) AddMovieToWatchlist(movieID, watchlistID string) error
- func (r *MongoDBRepository) CreateWatchlist(ctx context.Context, usrID, name string) (string, error)
- func (r *MongoDBRepository) DeleteMovieInWatchlist(movieID, watchlistID string) error
- func (r *MongoDBRepository) DeleteWatchlist(watchlistID string) error
- func (r *MongoDBRepository) GetAllWatchlistByUserId(id string) ([]*Watchlist, error)
- func (r *MongoDBRepository) GetWatchlistById(id string) (*Watchlist, error)
- func (r *MongoDBRepository) ListAllMovies(id string) ([]*WatchlistMovie, error)
- func (r *MongoDBRepository) UpdateStatusWatchList(ctx context.Context, watchlistID string, status bool) error
- type Service
- func (s *Service) AddMovieToWatchlist(ctx context.Context, movieID, watchlistID string) error
- func (s *Service) CreateWatchlist(ctx context.Context, name string) (string, error)
- func (s *Service) DeleteMovieInWatchlist(ctx context.Context, movieID, watchlistID string) error
- func (s *Service) DeleteWatchlist(ctx context.Context, watchlistID string) error
- func (s *Service) GetAllWatchlistByUserId(ctx context.Context, userID string) ([]*WatchlistResponse, error)
- func (s *Service) GetWatchlistById(ctx context.Context, id string) (*WatchlistResponse, error)
- func (s *Service) ListAllMovies(ctx context.Context, id string) ([]string, error)
- func (s *Service) UpdateStatusWatchList(ctx context.Context, watchlistID string, status bool) (string, error)
- type Watchlist
- type WatchlistMovie
- type WatchlistResponse
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func NewHandler(srv service) *Handler
func (*Handler) AddMovieToWatchlist ¶
func (h *Handler) AddMovieToWatchlist(w http.ResponseWriter, r *http.Request)
func (*Handler) CreateWatchlist ¶
func (h *Handler) CreateWatchlist(w http.ResponseWriter, r *http.Request)
func (*Handler) DeleteMovieInWatchlist ¶
func (h *Handler) DeleteMovieInWatchlist(w http.ResponseWriter, r *http.Request)
func (*Handler) DeleteWatchlist ¶
func (h *Handler) DeleteWatchlist(w http.ResponseWriter, r *http.Request)
func (*Handler) GetAllMoviesInWatchlist ¶
func (h *Handler) GetAllMoviesInWatchlist(w http.ResponseWriter, r *http.Request)
func (*Handler) GetAllWatchlistByUserId ¶
func (h *Handler) GetAllWatchlistByUserId(w http.ResponseWriter, r *http.Request)
func (*Handler) GetWatchlistById ¶
func (h *Handler) GetWatchlistById(w http.ResponseWriter, r *http.Request)
func (*Handler) UpdateStatusWatchList ¶
func (h *Handler) UpdateStatusWatchList(w http.ResponseWriter, r *http.Request)
type MongoDBRepository ¶
type MongoDBRepository struct {
// contains filtered or unexported fields
}
func NewRepository ¶
func NewRepository(session *mgo.Session) *MongoDBRepository
func (*MongoDBRepository) AddMovieToWatchlist ¶
func (r *MongoDBRepository) AddMovieToWatchlist(movieID, watchlistID string) error
func (*MongoDBRepository) CreateWatchlist ¶
func (*MongoDBRepository) DeleteMovieInWatchlist ¶
func (r *MongoDBRepository) DeleteMovieInWatchlist(movieID, watchlistID string) error
func (*MongoDBRepository) DeleteWatchlist ¶
func (r *MongoDBRepository) DeleteWatchlist(watchlistID string) error
func (*MongoDBRepository) GetAllWatchlistByUserId ¶
func (r *MongoDBRepository) GetAllWatchlistByUserId(id string) ([]*Watchlist, error)
func (*MongoDBRepository) GetWatchlistById ¶
func (r *MongoDBRepository) GetWatchlistById(id string) (*Watchlist, error)
func (*MongoDBRepository) ListAllMovies ¶
func (r *MongoDBRepository) ListAllMovies(id string) ([]*WatchlistMovie, error)
func (*MongoDBRepository) UpdateStatusWatchList ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(repository repository) *Service
func (*Service) AddMovieToWatchlist ¶
func (*Service) CreateWatchlist ¶
func (*Service) DeleteMovieInWatchlist ¶
func (*Service) DeleteWatchlist ¶
func (*Service) GetAllWatchlistByUserId ¶
func (*Service) GetWatchlistById ¶
func (*Service) ListAllMovies ¶
type Watchlist ¶
type Watchlist struct { ID string `bson:"_id"` UserID string `bson:"user_id"` Name string `bson:"name"` CreatedAt time.Time `bson:"created_at"` UpdatedAt time.Time `bson:"updated_at"` }
func (*Watchlist) ConvertToWatchlistResponse ¶
func (w *Watchlist) ConvertToWatchlistResponse() *WatchlistResponse
type WatchlistMovie ¶
Click to show internal directories.
Click to hide internal directories.