service

package
v0.0.0-...-9d4efbb Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MovieService

type MovieService struct {
	MovieRepo *MovieRepository
}

func NewMovieService

func NewMovieService(c *MovieRepository) *MovieService

func (*MovieService) Create

func (m *MovieService) Create(mv *Movie) (*Movie, error)

func (*MovieService) Delete

func (m *MovieService) Delete(id int) (bool, error)

func (*MovieService) GetAll

func (m *MovieService) GetAll() (*MovieList, error)

GetAll returns all categories

func (*MovieService) GetAllMoviesWithPagination

func (m *MovieService) GetAllMoviesWithPagination(pag Pagination) (*Pagination, error)

func (*MovieService) Migrate

func (m *MovieService) Migrate()

func (*MovieService) Update

func (m *MovieService) Update(mv *Movie, id int) (*Movie, error)

func (*MovieService) Upload

func (m *MovieService) Upload(file *multipart.File) (int, string, error)

Upload helps to read file and compare after that create on db

type UserService

type UserService struct {
	UserRepo UserRepositoryInterface
}

func NewUserService

func NewUserService(u UserRepositoryInterface) *UserService

func (*UserService) CheckUser

func (u *UserService) CheckUser(user *User) (bool, error)

CheckUser helps to identify user is registered before or not

func (*UserService) Login

func (u *UserService) Login(email string, password string) (*User, error)

Login helps user to enter system after checking e-mail,password

func (*UserService) Migrate

func (u *UserService) Migrate()

func (*UserService) Save

func (u *UserService) Save(user *User) (*User, error)

Save helps to create user after check verify e-mail,password

type UserServiceInterface

type UserServiceInterface interface {
	CheckUser(user *User) (bool, error)
	Save(user *User) (*User, error)
	Login(email string, password string) (*User, error)
	Migrate()
}

Jump to

Keyboard shortcuts

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