service

package
v0.0.0-...-2993ae5 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthService

type AuthService interface {
	VerifyCredential(email string, password string) interface{}
	CreateUser(user dto.RegisterDTO) entity.User
	FindByEmail(email string) entity.User
	IsDuplicateEmail(email string) bool
}

interface use case need to do for authen

func NewAuthService

func NewAuthService(userRep repository.UserRepository) AuthService

type BookService

type BookService interface {
	Insert(b dto.BookCreateDTO) entity.Book
	Update(b dto.BookUpdateDTO) entity.Book
	Delete(b entity.Book)
	All() []entity.Book
	FinById(bookID uint64) entity.Book
	IsAllowedToEdit(userID string, bookID uint64) bool
}

func NewBookService

func NewBookService(bookRepo repository.BookRepository) BookService

type JWTService

type JWTService interface {
	GenerateToken(UserID string) string
	ValidateToken(token string) (*jwt.Token, error)
}

A contract of what jwtService can do

func NewJWTService

func NewJWTService() JWTService

type UserService

type UserService interface {
	Update(user dto.UserUpdateDTO) entity.User
	Profile(userID string) entity.User
}

func NewUserService

func NewUserService(userRepo repository.UserRepository) UserService

Jump to

Keyboard shortcuts

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