service

package
v0.0.0-...-f2087f5 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2022 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 AnswerService

type AnswerService interface {
	InsertAnswer(b dto.AnswerCreateDTO) entity.Answer
	UpdateAnswer(b dto.AnswerUpdateDTO) entity.Answer
	DeleteAnswer(b entity.Answer)
	AllAnswer() []entity.Answer
	FindAnswerById(AnswerID uint64) entity.Answer
	IsAllowedToEditAnswer(userID string, answerID uint64) bool
}

func NewAnswerService

func NewAnswerService(answerRepo repository.AnswerRepository) AnswerService

type AuthService

type AuthService interface {
	VerifyCredential(email string, password string) interface{}
}

func NewAuthService

func NewAuthService(userRepo repository.UserRepository) AuthService

type JWTService

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

func NewJWTService

func NewJWTService() JWTService

type QuestionService

type QuestionService interface {
	Insert(b dto.QuestionCreateDTO) entity.Question
	Update(b dto.QuestionUpdateDTO) entity.Question
	Delete(b entity.Question, questionID uint64)
	All() []entity.Question
	FindById(QuestionID uint64) entity.Question
	IsAllowedToEdit(userID string, questionID uint64) bool
	FindAnswer(questionID uint64) []entity.Answer
}

func NewQuestionService

func NewQuestionService(questionRepo repository.QuestionRepository) QuestionService

type UserService

type UserService interface {
	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