service

package
v0.0.0-...-c2d5d3e Latest Latest
Warning

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

Go to latest
Published: May 25, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Answer

type Answer interface {
}

type AuthService

type AuthService struct {
	// contains filtered or unexported fields
}

func NewAuthService

func NewAuthService(repo repository.Authorization) *AuthService

func (*AuthService) CreateUser

func (s *AuthService) CreateUser(user models.User) (int, error)

func (*AuthService) GenerateToken

func (s *AuthService) GenerateToken(username, password string) (string, error)

func (*AuthService) ParseToken

func (s *AuthService) ParseToken(accessToken string) (int, error)

type Authorization

type Authorization interface {
	CreateUser(user models.User) (int, error)
	GenerateToken(username, password string) (string, error)
	ParseToken(token string) (int, error)
}

type Question

type Question interface {
}

type Quiz

type Quiz interface {
	Create(userId int, quiz models.Quiz) (int, error)
}

type QuizService

type QuizService struct {
	// contains filtered or unexported fields
}

func NewQuizService

func NewQuizService(repo repository.Quiz) *QuizService

func (*QuizService) Create

func (s *QuizService) Create(userId int, quiz models.Quiz) (int, error)

type Service

type Service struct {
	Authorization
	Quiz
	Question
	Answer
}

func NewService

func NewService(repos *repository.Repository) *Service

Jump to

Keyboard shortcuts

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