service

package
v0.0.0-...-0cee42a Latest Latest
Warning

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

Go to latest
Published: Jan 23, 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.UserCreateDTO) model.User
	FindEmail(email string) model.User
	IsDuplicateEmail(email string) bool
}

AuthService interface that cover all function needed

func NewAuthService

func NewAuthService(userRep repository.UserRepository) AuthService

NewAuthService is used to create new Instance

type BookService

type BookService interface {
	InsertBook(book dto.BookCreateDTO) model.Book
	UpdateBook(book dto.BookUpdateDTO) model.Book
	DeleteBook(book model.Book)
	GetAll() []model.Book
	FindBookByID(id uint64) model.Book
	AuthorizeForEdit(userID string, bookID uint64) bool
}

BookService interface for book service

func NewBookService

func NewBookService(bookRepo repository.BookRepository) BookService

NewBookService is new Instance

type JWTService

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

JWTService is used for tokenize header

func NewJwtService

func NewJwtService() JWTService

NewJwtService is for create new Instance

type UserService

type UserService interface {
	UpdateUser(user dto.UserUpdateDTO) model.User
	GetUser(userID string) model.User
}

UserService interface for user service

func NewUserService

func NewUserService(userRepo repository.UserRepository) UserService

NewUserService is new Instance

Jump to

Keyboard shortcuts

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