services

package module
v0.0.0-...-adc4229 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2024 License: CC0-1.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Movies

type Movies struct {
	Movies      []types.Movie      // List of movies
	UserRatings map[int]types.User // Map of user ratings
}

Movies represents the structure of the movies service.

func NewMovies

func NewMovies() *Movies

NewMovies creates a new Movies service.

func (*Movies) GetMovieById

func (m *Movies) GetMovieById(idMovie int) (*types.Movie, error)

GetMovieByTitle returns a movie by id.

func (*Movies) GetMovieByTitle

func (m *Movies) GetMovieByTitle(title string) *types.Movie

GetMovieByTitle returns a movie by its title.

func (*Movies) GetRandomUserID

func (m *Movies) GetRandomUserID() int

GetRandomUserID returns a random user ID.

func (*Movies) LoadMovies

func (m *Movies) LoadMovies(filePath string) error

LoadMovies load movies from a JSON file.

func (*Movies) LoadRatings

func (m *Movies) LoadRatings(filePath string) error

LoadRatings load ratings from a CSV file.

Jump to

Keyboard shortcuts

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