repositories

package
v0.0.0-...-8c0880b Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MovieRepository

type MovieRepository interface {
	// GetAllMovies returns all movies, the number of modified rows and any error encountered.
	GetAllMovies() ([]models.Movie, int64, error)

	// GetMovieById returns a movie for a given id, the number of modified rows and any error encountered.
	GetMovieById(id int) (models.Movie, int64, error)

	// CreateMovie saves a movie to database and returns
	// the created movie, the number of modified rows and any error encountered.
	CreateMovie(movie *models.Movie) (models.Movie, int64, error)

	// UpdateMovie updates an existing and returns the updated movie, the number of modified rows
	// and any error encountered.
	UpdateMovie(id int, movie *models.Movie) (models.Movie, int64, error)

	// DeleteMovieById deletes a movie for a given id and returns the number of modified rows
	// and any error encountered.
	DeleteMovieById(id int) (int64, error)
}

MovieRepository contract.

func MovieRepositoryImpl

func MovieRepositoryImpl(database *gorm.DB) MovieRepository

MovieRepositoryImpl builds and returns a movie repository implementation.

Jump to

Keyboard shortcuts

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